From 09c856bf72de41e82582f31855e916295ba6d382 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 30 Jul 2024 01:44:21 +0100 Subject: [PATCH] Update `test_renderer` so that tests pass with Sphinx 7.2 (#976) 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`. --- tests/test_renderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_renderer.py b/tests/test_renderer.py index a858c65d8..0fd044a5c 100644 --- a/tests/test_renderer.py +++ b/tests/test_renderer.py @@ -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_