(
tmp_path_factory: pytest.TempPathFactory,
rootdir: str | os.PathLike[str] | None,
)
| 24 | |
| 25 | |
| 26 | def test_instantiation( |
| 27 | tmp_path_factory: pytest.TempPathFactory, |
| 28 | rootdir: str | os.PathLike[str] | None, |
| 29 | ) -> None: |
| 30 | # Given |
| 31 | src_dir = tmp_path_factory.getbasetemp() / 'root' |
| 32 | |
| 33 | # special support for sphinx/tests |
| 34 | if rootdir and not src_dir.exists(): |
| 35 | shutil.copytree(Path(str(rootdir)) / 'test-root', src_dir) |
| 36 | |
| 37 | saved_path = sys.path.copy() |
| 38 | |
| 39 | # When |
| 40 | app_ = SphinxTestApp( |
| 41 | srcdir=src_dir, |
| 42 | status=StringIO(), |
| 43 | warning=StringIO(), |
| 44 | ) |
| 45 | sys.path[:] = saved_path |
| 46 | app_.cleanup() |
| 47 | |
| 48 | # Then |
| 49 | assert isinstance(app_, sphinx.application.Sphinx) |
| 50 | |
| 51 | |
| 52 | @pytest.mark.sphinx('html', testroot='root') |
nothing calls this directly
no test coverage detected
searching dependent graphs…