Debian Codegraph @

tests/test_environment/test_environment_record_dependencies.py

raw
1 """Tests for ``record_dependencies``."""
2
3 from __future__ import annotations
4
5 from typing import TYPE_CHECKING
6
7 import pytest
8
9 if TYPE_CHECKING:
10 from sphinx.testing.util import SphinxTestApp
11
12
13 @pytest.mark.sphinx('html', testroot='environment-record-dependencies')
14 def test_record_dependencies_cleared(app: SphinxTestApp) -> None:
15 app.builder.read()
16 assert 'index' not in app.env.dependencies
17 assert app.env.dependencies['api'] == {app.srcdir / 'example_module.py'}