{"library":"pytest-doctestplus","title":"pytest-doctestplus","description":"pytest-doctestplus is a pytest plugin that extends the standard Python doctest functionality with advanced features for testing example code in Python docstrings, reStructuredText (.rst), Markdown (.md), and TeX (.tex) files. It is currently at version 1.7.1 and maintains a consistent release cadence with new features, bug fixes, and compatibility updates for Python and pytest versions.","language":"python","status":"active","last_verified":"Sun Apr 12","install":{"commands":["pip install pytest-doctestplus"],"cli":{"name":"pytest","version":"pytest 9.0.3"}},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pytest\n\n# my_module.py\ndef greet(name):\n    \"\"\"\n    Greets the given name.\n\n    >>> greet('World')\n    'Hello, World!'\n\n    >>> greet('pytest-doctestplus') # doctest: +SKIP\n    'Hello, pytest-doctestplus!'\n    \"\"\"\n    return f'Hello, {name}!'\n\n# To run the doctests from the command line, save the above as my_module.py\n# and run pytest:\n# pytest --doctest-plus my_module.py","lang":"python","description":"To quickly test doctests using pytest-doctestplus, place your doctests in docstrings or .rst files. Then, simply invoke pytest with the `--doctest-plus` flag. This example shows a simple function with a doctest and how to run it, including a skipped test using a doctest directive.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}