File: fix_tests_with_Sphinx_7.2.patch

package info (click to toggle)
python-sphinxcontrib.apidoc 0.3.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: python: 241; makefile: 18
file content (93 lines) | stat: -rw-r--r-- 3,301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
From 42e23598d9784bc56b4d44ff092c678ec5d054d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mark=C3=A9ta?= <meggy.calabkova@gmail.com>
Date: Wed, 30 Aug 2023 13:22:59 +0200
Subject: [PATCH] fix tests with Sphinx 7.2

---
 tests/conftest.py |  9 ++++-----
 tests/test_ext.py | 12 ++++++------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/tests/conftest.py b/tests/conftest.py
index d5b1c7c..a6d1ff9 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -10,7 +10,7 @@
 import tempfile
 
 import pytest
-from sphinx.testing.path import path
+from pathlib import Path
 
 pytest_plugins = 'sphinx.testing.fixtures'
 
@@ -19,11 +19,10 @@
 
 @pytest.fixture(scope='session')
 def sphinx_test_tempdir():
-    return path(
+    return Path(
         os.environ.get('SPHINX_TEST_TEMPDIR',
-                       tempfile.mkdtemp(prefix='apidoc-'))).abspath()
-
+                       tempfile.mkdtemp(prefix='apidoc-'))).resolve()
 
 @pytest.fixture(scope='session')
 def rootdir():
-    return path(os.path.dirname(__file__) or '.').abspath() / 'roots'
+    return Path(os.path.dirname(__file__) or '.').resolve() / 'roots'
diff --git a/tests/test_ext.py b/tests/test_ext.py
index 7cbb487..8275c0a 100644
--- a/tests/test_ext.py
+++ b/tests/test_ext.py
@@ -19,12 +19,12 @@ def test_basics(app, status, warning):
     logging.setup(app, status, warning)
     app.builder.build_all()
 
-    assert (app.srcdir / 'api').isdir()
+    assert (app.srcdir / 'api').is_dir()
     assert (app.srcdir / 'api' / 'modules.rst').exists()
     assert (app.srcdir / 'api' / 'apidoc_dummy_module.rst').exists()
     assert not (app.srcdir / 'api' / 'conf.rst').exists()
 
-    assert (app.outdir / 'api').isdir()
+    assert (app.outdir / 'api').is_dir()
     assert (app.outdir / 'api' / 'modules.html').exists()
     assert (app.outdir / 'api' / 'apidoc_dummy_module.html').exists()
     assert not (app.outdir / 'api' / 'conf.html').exists()
@@ -40,7 +40,7 @@ def test_advanced(app, status, warning):
     logging.setup(app, status, warning)
     app.builder.build_all()
 
-    assert (app.srcdir / 'api').isdir()
+    assert (app.srcdir / 'api').is_dir()
     assert (app.srcdir / 'api' / 'custom.rst').exists()
     for module in [
             'apidoc_dummy_module.rst',
@@ -58,7 +58,7 @@ def test_advanced(app, status, warning):
     # The 'Module contents' header isn't present if '--module-first' used
     assert 'Module contents' not in package_doc
 
-    assert (app.outdir / 'api').isdir()
+    assert (app.outdir / 'api').is_dir()
     assert (app.outdir / 'api' / 'custom.html').exists()
     for module in [
             'apidoc_dummy_module.html',
@@ -79,7 +79,7 @@ def test_advanced_negative(app, status, warning):
     logging.setup(app, status, warning)
     app.builder.build_all()
 
-    assert (app.srcdir / 'api').isdir()
+    assert (app.srcdir / 'api').is_dir()
     for module in [
             'apidoc_dummy_module.rst',
     ]:
@@ -94,7 +94,7 @@ def test_advanced_negative(app, status, warning):
     # The 'Module contents' header is present if '--module-first' isn't used
     assert 'Module contents' in package_doc
 
-    assert (app.outdir / 'api').isdir()
+    assert (app.outdir / 'api').is_dir()
     for module in [
             'apidoc_dummy_module.html',
     ]: