File: Make-the-tests-pass-with-Sphinx-7.x.patch

package info (click to toggle)
sphinx-panels 0.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 896 kB
  • sloc: python: 1,042; xml: 60; makefile: 23; sh: 16
file content (63 lines) | stat: -rw-r--r-- 2,539 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
From: Dmitry Shachnev <mitya57@debian.org>
Date: Fri, 3 Nov 2023 23:25:11 +0300
Subject: Make the tests pass with Sphinx 7.x

---
 tests/test_sphinx.py                               | 8 +++++++-
 tests/test_sphinx/test_sources_dropdown_basic_.xml | 2 +-
 tests/test_sphinx/test_sources_tabbed_basic_.xml   | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/test_sphinx.py b/tests/test_sphinx.py
index 9efc2c2..35affa1 100644
--- a/tests/test_sphinx.py
+++ b/tests/test_sphinx.py
@@ -2,6 +2,7 @@ from pathlib import Path
 import shutil
 
 import pytest
+import sphinx
 from sphinx.testing.path import path
 
 from sphinx_panels.tabs import TabbedHtmlTransform
@@ -15,7 +16,10 @@ def sphinx_app_factory(make_app, tmp_path: Path, monkeypatch):
         shutil.copytree(
             (Path(__file__).parent / "sources" / src_folder), tmp_path / src_folder
         )
-        app = make_app(srcdir=path(str((tmp_path / src_folder).absolute())), **kwargs)
+        srcdir = (tmp_path / src_folder).absolute()
+        if sphinx.version_info < (7, 2):
+            srcdir = path(str(srcdir))
+        app = make_app(srcdir=srcdir, **kwargs)
         return app
 
     yield _func
@@ -28,6 +32,8 @@ def test_sources(sphinx_app_factory, file_regression, folder):
     assert app._warning.getvalue() == ""
     doctree = app.env.get_and_resolve_doctree("index", app.builder)
     doctree["source"] = "source"
+    if sphinx.version_info < (7, 1):
+        doctree["translation_progress"] = "{'total': 0, 'translated': 0}"
     file_regression.check(
         doctree.pformat(),
         encoding="utf8",
diff --git a/tests/test_sphinx/test_sources_dropdown_basic_.xml b/tests/test_sphinx/test_sources_dropdown_basic_.xml
index b984330..4c42825 100644
--- a/tests/test_sphinx/test_sources_dropdown_basic_.xml
+++ b/tests/test_sphinx/test_sources_dropdown_basic_.xml
@@ -1,4 +1,4 @@
-<document source="source">
+<document source="source" translation_progress="{'total': 0, 'translated': 0}">
     <section ids="title" names="title">
         <title>
             Title
diff --git a/tests/test_sphinx/test_sources_tabbed_basic_.xml b/tests/test_sphinx/test_sources_tabbed_basic_.xml
index b3f2d1a..f55e06e 100644
--- a/tests/test_sphinx/test_sources_tabbed_basic_.xml
+++ b/tests/test_sphinx/test_sources_tabbed_basic_.xml
@@ -1,4 +1,4 @@
-<document source="source">
+<document source="source" translation_progress="{'total': 0, 'translated': 0}">
     <section ids="title" names="title">
         <title>
             Title