module documentation

Sphinx test fixtures for pytest

Class SharedResult Undocumented
Function app Provides the 'sphinx.application.Sphinx' object
Function app_params Parameters that are specified by 'pytest.mark.sphinx' for sphinx.application.Sphinx initialization
Function if_graphviz_found The test will be skipped when using 'if_graphviz_found' fixture and graphviz dot command is not found.
Function make_app Provides make_app function to initialize SphinxTestApp instance. if you want to initialize 'app' in your test function. please use this instead of using SphinxTestApp class directory.
Function pytest_configure Register custom markers
Function rollback_sysmodules Rollback sys.modules to its value before testing to unload modules during tests.
Function rootdir Undocumented
Function shared_result Undocumented
Function sphinx_test_tempdir Temporary directory wrapped with `path` class.
Function status Back-compatibility for testing with previous @with_app decorator
Function tempdir Temporary directory wrapped with `path` class. This fixture is for back-compatibility with old test implementation.
Function test_params Test parameters that are specified by 'pytest.mark.test_params'
Function warning Back-compatibility for testing with previous @with_app decorator
Constant DEFAULT_ENABLED_MARKERS Undocumented
Function _shared_result_cache Undocumented
@pytest.fixture(scope='function')
def app(test_params, app_params, make_app, shared_result): (source)

Provides the 'sphinx.application.Sphinx' object

Parameters
test_params:dictUndocumented
app_params:tuple[dict, dict]Undocumented
make_app:CallableUndocumented
shared_result:SharedResultUndocumented
Returns
Generator[SphinxTestApp, None, None]Undocumented
@pytest.fixture
def app_params(request, test_params, shared_result, sphinx_test_tempdir, rootdir): (source)

Parameters that are specified by 'pytest.mark.sphinx' for sphinx.application.Sphinx initialization

Parameters
request:AnyUndocumented
test_params:dictUndocumented
shared_result:SharedResultUndocumented
sphinx_test_tempdir:strUndocumented
rootdir:strUndocumented
Returns
tuple[dict, dict]Undocumented
@pytest.fixture
def if_graphviz_found(app): (source)

The test will be skipped when using 'if_graphviz_found' fixture and graphviz dot command is not found.

Parameters
app:SphinxTestAppUndocumented
@pytest.fixture()
def make_app(test_params, monkeypatch): (source)

Provides make_app function to initialize SphinxTestApp instance. if you want to initialize 'app' in your test function. please use this instead of using SphinxTestApp class directory.

Parameters
test_params:dictUndocumented
monkeypatch:AnyUndocumented
Returns
Generator[Callable, None, None]Undocumented
def pytest_configure(config): (source)

Register custom markers

@pytest.fixture
def rollback_sysmodules(): (source)

Rollback sys.modules to its value before testing to unload modules during tests. For example, used in test_ext_autosummary.py to permit unloading the target module to clear its cache.

@pytest.fixture(scope='session')
def rootdir(): (source)

Undocumented

Returns
str|NoneUndocumented
@pytest.fixture
def shared_result(): (source)

Undocumented

Returns
SharedResultUndocumented
@pytest.fixture(scope='session')
def sphinx_test_tempdir(tmpdir_factory): (source)

Temporary directory wrapped with `path` class.

Parameters
tmpdir_factory:AnyUndocumented
Returns
util.pathUndocumented
@pytest.fixture(scope='function')
def status(app): (source)

Back-compatibility for testing with previous @with_app decorator

Parameters
app:SphinxTestAppUndocumented
Returns
StringIOUndocumented
@pytest.fixture
def tempdir(tmpdir): (source)

Temporary directory wrapped with `path` class. This fixture is for back-compatibility with old test implementation.

Parameters
tmpdir:strUndocumented
Returns
util.pathUndocumented
@pytest.fixture
def test_params(request): (source)

Test parameters that are specified by 'pytest.mark.test_params' :param Union[str] shared_result: If the value is provided, app._status and app._warning objects will be shared in the parametrized test functions and/or test functions that have same 'shared_result' value. **NOTE**: You can not specify both shared_result and srcdir.

Parameters
request:AnyUndocumented
Returns
dictUndocumented
@pytest.fixture(scope='function')
def warning(app): (source)

Back-compatibility for testing with previous @with_app decorator

Parameters
app:SphinxTestAppUndocumented
Returns
StringIOUndocumented
DEFAULT_ENABLED_MARKERS: list[str] = (source)

Undocumented

Value
['sphinx(builder, testroot=None, freshenv=False, confoverrides=None, tags=None, 
docutilsconf=None, parallel=0): arguments to initialize the sphinx test applicat
ion.',
 'test_params(shared_result=...): test parameters.']
@pytest.fixture(scope='module', autouse=True)
def _shared_result_cache(): (source)

Undocumented