1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Testing API
===========
.. py:module:: sphinx.testing
:synopsis: Utility functions and pytest fixtures for testing.
.. versionadded:: 1.6
Utility functions and pytest fixtures for testing
are provided in :py:mod:`!sphinx.testing`.
If you are a developer of Sphinx extensions,
you can write unit tests with pytest_.
.. _pytest: https://docs.pytest.org/en/latest/
``pytest`` configuration
-------------------------
To use pytest fixtures that are provided by ``sphinx.testing``,
add the ``'sphinx.testing.fixtures'`` plugin
to your test modules or :file:`conftest.py` files as follows:
.. code-block:: python
pytest_plugins = ('sphinx.testing.fixtures',)
Usage
-----
If you want to know more detailed usage,
please refer to :file:`tests/conftest.py` and other :file:`test_*.py` files
under the :file:`tests/` directory.
|