Skip to content

Commit 40799b4

Browse files
committed
Tests: update test suite and fix some tests
I expect some versions to fail due to #240. If that's the case, we can merge #241 here and move forward with it.
1 parent ccdda49 commit 40799b4

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

.circleci/config.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ commands:
88
type: string
99
sphinx-version:
1010
type: string
11-
default: "5,6,7,latest"
11+
default: "5,6,7,8,latest,dev"
1212
steps:
1313
- checkout
1414
# NOTE: use Tox 3.x until I understand the syntax for generative environments:
@@ -23,12 +23,14 @@ jobs:
2323
steps:
2424
- run-tox:
2525
version: py38
26+
sphinx-version: "5,6"
2627
py39:
2728
docker:
2829
- image: 'cimg/python:3.9'
2930
steps:
3031
- run-tox:
3132
version: py39
33+
sphinx-version: "5,6,7"
3234
py310:
3335
docker:
3436
- image: 'cimg/python:3.10'

tests/examples/404rst/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# conf.py to run tests
22

3+
project = 'Python'
34
master_doc = 'index'
45
extensions = [
56
'notfound.extension',

tests/examples/default/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# conf.py to run tests
22

3+
project = 'Python'
34
master_doc = 'index'
45
extensions = [
56
'notfound.extension',

tests/test_urls.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,19 @@ def test_default_settings(app, status, warning):
6464
else:
6565
cssclass = ""
6666

67+
if sphinx.version_info < (7, 3):
68+
alt = "Logo"
69+
else:
70+
alt = "Logo of Python"
71+
6772
chunks = [
6873
'<h1>Page not found</h1>',
6974
"Unfortunately we couldn't find the content you were looking for.",
7075
'<title>Page not found &#8212; Python documentation</title>',
7176

7277
# favicon and logo
7378
f'<link rel="{cssclass}icon" href="/en/latest/_static/favicon.png"/>',
74-
'<img class="logo" src="/en/latest/_static/logo.svg" alt="Logo"/>',
79+
f'<img class="logo" src="/en/latest/_static/logo.svg" alt="{alt}"/>',
7580

7681
# sidebar URLs
7782
'<h1 class="logo"><a href="/en/latest/index.html">Python</a></h1>',
@@ -139,6 +144,11 @@ def test_urls_prefix_setting(app, status, warning):
139144
else:
140145
cssclass = ""
141146

147+
if sphinx.version_info < (7, 3):
148+
alt = "Logo"
149+
else:
150+
alt = "Logo of Python"
151+
142152
chunks = [
143153
# sidebar URLs
144154
'<h1 class="logo"><a href="/language/version/index.html">Python</a></h1>',
@@ -147,7 +157,7 @@ def test_urls_prefix_setting(app, status, warning):
147157

148158
# favicon and logo
149159
f'<link rel="{cssclass}icon" href="/language/version/_static/favicon.png"/>',
150-
'<img class="logo" src="/language/version/_static/logo.svg" alt="Logo"/>',
160+
f'<img class="logo" src="/language/version/_static/logo.svg" alt="{alt}"/>',
151161

152162
# resources
153163
_get_css_html_link_tag(app, 'language', 'version', 'alabaster.css'),
@@ -177,6 +187,12 @@ def test_urls_prefix_setting_none(app, status, warning):
177187
else:
178188
cssclass = ""
179189

190+
if sphinx.version_info < (7, 3):
191+
alt = "Logo"
192+
else:
193+
alt = "Logo of Python"
194+
195+
180196
chunks = [
181197
# sidebar URLs
182198
'<h1 class="logo"><a href="/index.html">Python</a></h1>',
@@ -185,7 +201,7 @@ def test_urls_prefix_setting_none(app, status, warning):
185201

186202
# favicon and logo
187203
f'<link rel="{cssclass}icon" href="/_static/favicon.png"/>',
188-
'<img class="logo" src="/_static/logo.svg" alt="Logo"/>',
204+
f'<img class="logo" src="/_static/logo.svg" alt="{alt}"/>',
189205

190206
# resources
191207
_get_css_html_link_tag(app, '', '', 'alabaster.css'),

tox.ini

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ isolated_build = True
44

55
envlist =
66
docs
7-
py{38,39,310,311,312}-sphinx{5,6,7,latest}
7+
py{38}-sphinx{5,6}
8+
py{39}-sphinx{5,6,7}
9+
py{310,311,312}-sphinx{5,6,7,8,latest,dev}
810

911
[testenv]
1012
deps =
@@ -15,7 +17,9 @@ deps =
1517
sphinx5: sphinx<6.0
1618
sphinx6: sphinx<7.0
1719
sphinx7: sphinx<8.0
20+
sphinx8: sphinx<9.0
1821
sphinxlatest: sphinx
22+
sphinxdev: https://github.com/sphinx-doc/sphinx/archive/refs/heads/master.zip
1923
commands = pytest {posargs}
2024

2125
[testenv:docs]

0 commit comments

Comments
 (0)