Start using `pathlib.Path and deprecate sphinx.testing.path` (#11526)

This commit is contained in:
Adam Turner
2023-07-28 00:39:12 +01:00
committed by GitHub
parent 23c7fdde75
commit 49d8304670
51 changed files with 490 additions and 630 deletions

View File

@@ -1363,7 +1363,7 @@ def test_domain_cpp_build_field_role(app, status, warning):
@pytest.mark.sphinx(testroot='domain-cpp-intersphinx', confoverrides={'nitpicky': True})
def test_domain_cpp_build_intersphinx(tempdir, app, status, warning):
def test_domain_cpp_build_intersphinx(tmp_path, app, status, warning):
origSource = """\
.. cpp:class:: _class
.. cpp:struct:: _struct
@@ -1385,7 +1385,7 @@ def test_domain_cpp_build_intersphinx(tempdir, app, status, warning):
.. cpp:function:: void _functionParam(int param)
.. cpp:function:: template<typename TParam> void _templateParam()
""" # noqa: F841
inv_file = tempdir / 'inventory'
inv_file = tmp_path / 'inventory'
inv_file.write_bytes(b'''\
# Sphinx inventory version 2
# Project: C Intersphinx Test
@@ -1413,7 +1413,7 @@ _union cpp:union 1 index.html#_CPPv46$ -
_var cpp:member 1 index.html#_CPPv44$ -
''')) # noqa: W291
app.config.intersphinx_mapping = {
'https://localhost/intersphinx/cpp/': inv_file,
'https://localhost/intersphinx/cpp/': str(inv_file),
}
app.config.intersphinx_cache_limit = 0
# load the inventory and check if it's done correctly