Skip to content

Commit

Permalink
Update test_renderer so that tests pass with Sphinx 7.2 (#976)
Browse files Browse the repository at this point in the history
Sphinx was updated in July 2023 so that importing `sphinx.testing.path`
no longer causes Sphinx application paths to belong to the 
class `sphinx.testing.path.path`, which has a `makedirs` method.

Instead, Sphinx application paths are now ordinary `Path` objects
which lack this method, so we use `os.makedirs` instead. This is
backwards compatible as `sphinx.testing.path.path` objects are
pathlike and so accepted by `os.makedirs`.
  • Loading branch information
gareth-rees authored Jul 30, 2024
1 parent ea348fe commit 09c856b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def app(test_params, app_params, make_app, shared_result):
"""
args, kwargs = app_params
assert "srcdir" in kwargs
kwargs["srcdir"].makedirs(exist_ok=True)
os.makedirs(kwargs["srcdir"], exist_ok=True)
(kwargs["srcdir"] / "conf.py").write_text("")
app_ = make_app(*args, **kwargs)
yield app_
Expand Down

0 comments on commit 09c856b

Please sign in to comment.