python-sphinx-notfound-page/sphinx-3.4-compatibility.patch
2021-07-07 10:35:52 +08:00

47 lines
1.6 KiB
Diff

diff --git a/tests/test_urls.py b/tests/test_urls.py
index 3e0d0f3..1d9736d 100644
--- a/tests/test_urls.py
+++ b/tests/test_urls.py
@@ -33,7 +33,7 @@ def test_parallel_build():
# TODO: migrate to `app.build(..., parallel=2)` after merging
# https://github.com/sphinx-doc/sphinx/pull/8257
subprocess.check_call('sphinx-build -j 2 -W -b html tests/examples/parallel-build build', shell=True)
-
+
@pytest.mark.sphinx(srcdir=srcdir)
def test_404_page_created(app, status, warning):
app.build()
@@ -529,7 +529,10 @@ def test_sphinx_resource_urls(app, status, warning):
'<script src="/en/latest/_static/doctools.js"></script>',
]
- if sphinx.version_info >= (1, 8):
+ # This file was added to all the HTML pages in Sphinx>=1.8. However, it was
+ # only required for search page. Sphinx>=3.4 fixes this and only adds it on
+ # search. See (https://github.com/sphinx-doc/sphinx/blob/v3.4.0/CHANGES#L87)
+ if (1, 8) <= sphinx.version_info < (3, 4, 0):
if sphinx.version_info < (2, 4, 0):
chunks.append(
'<script type="text/javascript" src="/en/latest/_static/language_data.js"></script>',
diff --git a/tox.ini b/tox.ini
index 47c0ce6..eade55e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,7 +2,7 @@
envlist =
docs
py27-sphinx{17,18}
- py{36,37,38}-sphinx{17,18,20,21,22,23,24,30,31,32,33}
+ py{36,37,38}-sphinx{17,18,20,21,22,23,24,30,31,32,33,34}
[testenv]
deps =
@@ -20,6 +20,7 @@ deps =
sphinx31: sphinx~=3.1.0
sphinx32: sphinx~=3.2.0
sphinx33: sphinx~=3.3.0
+ sphinx34: sphinx~=3.4.0
commands = pytest {posargs}
[testenv:py38-sphinx30]