pytest-sphinx 0.7.1


pip install pytest-sphinx

  Latest version

Released: Jan 21, 2026

Project Links

Meta
Author: Thomas Wimmer
Maintainer: Thomas Wimmer
Requires Python: >=3.10

Classifiers

Development Status
  • 4 - Beta

Framework
  • Pytest

Intended Audience
  • Developers

Topic
  • Software Development :: Testing

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: Implementation :: CPython

Operating System
  • OS Independent

License
  • OSI Approved :: BSD License
Action Status

A doctest plugin for pytest, which understands the sphinx-specific directives from doctest-sphinx. Those sphinx-specific directives can be used in rst files as well as in docstrings of python modules.

Features

  • support for the doctest directive

  • support for testcode and testoutput directives

  • support for testsetup and testcleanup is planned (pull-requests welcome)

  • support for parsing global optionflags (doctest_optionflags) from pytest.ini

  • support for :options: in testoutput

  • support for :skipif: in testcode and in testoutput

  • :hide: is ignored by “pytest-sphinx”

Requirements

  • pytest

Installation

You can install “pytest-sphinx” via pip from PyPI:

$ pip install pytest-sphinx

Usage

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3 license, “pytest-sphinx” is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
pytest (>=8.1.1)