Skip to content

Commit e9944e3

Browse files
committed
Fix tests
1 parent 15c4f14 commit e9944e3

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

docs/src/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# Extension options
3737
codeautolink_autodoc_inject = True
3838
codeautolink_custom_blocks = {"python3": None, "pycon3": clean_pycon}
39+
suppress_warnings = ["config.cache"]
3940

4041
autodoc_default_options = {"members": True, "undoc-members": True}
4142
autodoc_typehints = "description"

tests/extension/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"""
2929

3030
any_whitespace = re.compile(r"\s*")
31-
ref_tests = list(Path(__file__).with_name("ref").glob("*.txt"))
31+
ref_tests = [(p.name, p) for p in Path(__file__).with_name("ref").glob("*.txt")]
3232
ref_xfails = {
3333
"ref_fluent_attrs.txt": sys.version_info < (3, 8),
3434
"ref_fluent_call.txt": sys.version_info < (3, 8),
@@ -47,8 +47,8 @@ def assert_links(file: Path, links: list):
4747
assert s == link
4848

4949

50-
@pytest.mark.parametrize("file", ref_tests)
51-
def test_references(file: Path, tmp_path: Path):
50+
@pytest.mark.parametrize(("name", "file"), ref_tests)
51+
def test_references(name: str, file: Path, tmp_path: Path):
5252
"""
5353
Basic extension tests for reference building.
5454
@@ -72,6 +72,7 @@ def test_references(file: Path, tmp_path: Path):
7272
links = []
7373

7474
files = {"conf.py": default_conf + conf, "index.rst": index}
75+
print(f"Building file {name}.")
7576
result_dir = _sphinx_build(tmp_path, "html", files)
7677

7778
assert_links(result_dir / "index.html", links)

tests/extension/ref/custom_block.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def clean(s):
55
return s, s.replace("-*-", "")
66

77
codeautolink_custom_blocks = {"python": clean}
8+
suppress_warnings = ["config.cache"]
89
# split
910
Test project
1011
============

tests/extension/ref/custom_block_imported.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ test_project
22
test_project.bar
33
# split
44
codeautolink_custom_blocks = {"python": "parser_func.clean"}
5+
suppress_warnings = ["config.cache"]
56
# split
67
Test project
78
============

tests/extension/ref/ref_extdoctest_doctest.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test_project.Foo
77
from sphinx_codeautolink.extension.block import clean_pycon
88
extensions.append("sphinx.ext.doctest")
99
codeautolink_custom_blocks = {"pycon3": clean_pycon}
10+
suppress_warnings = ["config.cache"]
1011
# split
1112
Test project
1213
============

0 commit comments

Comments
 (0)