{"id":17322074,"url":"https://github.com/liiight/pytest-docs","last_synced_at":"2025-04-14T16:11:34.269Z","repository":{"id":33279864,"uuid":"155728827","full_name":"liiight/pytest-docs","owner":"liiight","description":"Documentation tool for pytest","archived":true,"fork":false,"pushed_at":"2022-05-10T07:34:27.000Z","size":83,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T16:11:26.446Z","etag":null,"topics":["documentation","pytest","pytest-plugin","python","python3","tool"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liiight.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-01T14:36:29.000Z","updated_at":"2025-04-04T12:52:19.000Z","dependencies_parsed_at":"2022-08-08T19:30:36.909Z","dependency_job_id":null,"html_url":"https://github.com/liiight/pytest-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiight%2Fpytest-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiight%2Fpytest-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiight%2Fpytest-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liiight%2Fpytest-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liiight","download_url":"https://codeload.github.com/liiight/pytest-docs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248914116,"owners_count":21182359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","pytest","pytest-plugin","python","python3","tool"],"created_at":"2024-10-15T13:40:57.666Z","updated_at":"2025-04-14T16:11:34.239Z","avatar_url":"https://github.com/liiight.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===========\npytest-docs\n===========\n\nA `pytest`_ plugin that generates documentation of the testing application itself.\n\n.. image:: https://img.shields.io/pypi/v/pytest-docs.svg\n    :target: https://pypi.org/project/pytest-docs\n    :alt: PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-docs.svg\n    :target: https://pypi.org/project/pytest-docs\n    :alt: Python versions\n\n.. image:: https://travis-ci.org/liiight/pytest-docs.svg?branch=master\n    :target: https://travis-ci.org/liiight/pytest-docs\n    :alt: Travis CI\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/ambv/black\n    :alt: Black\n\n.. image:: https://pepy.tech/badge/pytest-docs\n    :target: https://pepy.tech/project/pytest-docs\n    :alt: Pepy.tech\n\n.. image:: https://codecov.io/gh/liiight/pytest_docs/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/liiight/pytest_docs\n\n\nFeatures\n--------\n\nCreate documentation of your tests. Turns this:\n\n.. code-block::\n\n    '''This is the module doc'''\n    import pytest\n\n    pytestmark = [\n        pytest.mark.module_mark,\n        pytest.mark.module_mark_2,\n        pytest.mark.pytest_doc(name=\"Test Docs\"),\n    ]\n\n\n    @pytest.mark.class_marker\n    @pytest.mark.pytest_doc(name=\"Test Class\")\n    class TestClass:\n        '''This is the class doc'''\n\n        @pytest.mark.func_mark_a(\"foo\")\n        def test_func_a(self):\n            '''This is the doc for test_func_a'''\n            assert 1\n\n        @pytest.mark.kwarg_mark(goo=\"bla\")\n        def test_func_b(self):\n            '''This is the doc for test_func_b'''\n            assert 1\n\nTo this:\n\n.. code-block::\n\n    # Test Docs\n    This is the module doc\n\n    **Markers:**\n    - module_mark\n    - module_mark_2\n    - pytest_doc  (name=Test Docs)\n    ## Test Class\n    This is the class doc\n\n    **Markers:**\n    - pytest_doc  (name=Test Class)\n    - class_marker\n    ### test_func_a\n    This is the doc for test_func_a\n\n    **Markers:**\n    - func_mark_a (foo)\n    ### test_func_b\n    This is the doc for test_func_b\n\n    **Markers:**\n    - kwarg_mark  (goo=bla)\n\nCurrent supported formats:\n\n- Markdown\n- reStrcutured text\n\nWhy not sphinx?\n---------------\n\n(More accurately, why not sphinx-autodoc?)\nSphinx is an amazing tool that I use and used in other project. To use its autodoc plugin, it need the documented plugin to be importable by the python interperter. Pytest test collection and invocation uses a completely separate mechanism.\nIf you believe that it somehow possible to use sphinx to create pytest documentation, please do not hesitate to contact me.\n\nRequirements\n------------\n\n- Python 3.4, 3.5, 3.6 or 3.7\n- Pytest \u003e= 3.5.0\n\nInstallation\n------------\n\nYou can install \"pytest-docs\" via `pip`_ from `PyPI`_::\n\n    $ pip install pytest-docs\n\n\nUsage\n-----\n\nUse ``--docs [PATH]`` to create the documentation.\n\nUse ``--doc-type`` to select the type (currently supports ``md`` and ``rst``)\n\nUse  ``@pytest.mark.pytest_doc(name=\"Test Class\")`` to override name of element. It'll override name based on the place it is being used (module, class or function).\n\n**Note:** pytest-docs uses the pytest collection mechanism, so your documentation will be generated according the the usual collection commands used to run the tests.\n\nWhat's planned ahead\n--------------------\n\n1. See if anyone is even interested in this\n2. Document fixtures\n3. Document tests and fixtures parametrization\n4. Custom formatters via hooks\n\nContributing\n------------\nContributions are very welcome. Tests can be run with `tox`_, please ensure\nthe coverage at least stays the same before you submit a pull request.\n\nLicense\n-------\n\nDistributed under the terms of the `MIT`_ license, \"pytest-docs\" is free and open source software\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause\n.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt\n.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/liiight/pytest-docs/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.io/en/latest/\n.. _`pip`: https://pypi.org/project/pip/\n.. _`PyPI`: https://pypi.org/project\n\nThis `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliiight%2Fpytest-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliiight%2Fpytest-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliiight%2Fpytest-docs/lists"}