Skip to content

Tests: update test suite and fix some tests #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ commands:
type: string
sphinx-version:
type: string
default: "5,6,7,latest"
default: "5,6,7,8,latest,dev"
steps:
- checkout
# NOTE: use Tox 3.x until I understand the syntax for generative environments:
Expand All @@ -23,12 +23,14 @@ jobs:
steps:
- run-tox:
version: py38
sphinx-version: "5,6"
py39:
docker:
- image: 'cimg/python:3.9'
steps:
- run-tox:
version: py39
sphinx-version: "5,6,7"
py310:
docker:
- image: 'cimg/python:3.10'
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@ package-lock.json
node_modules

# vscode
.vscode/
.vscode/

# PyPI build
_build/
1 change: 1 addition & 0 deletions tests/examples/404rst/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# conf.py to run tests

project = 'Python'
master_doc = 'index'
extensions = [
'notfound.extension',
Expand Down
1 change: 1 addition & 0 deletions tests/examples/default/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# conf.py to run tests

project = 'Python'
master_doc = 'index'
extensions = [
'notfound.extension',
Expand Down
22 changes: 19 additions & 3 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,19 @@ def test_default_settings(app, status, warning):
else:
cssclass = ""

if sphinx.version_info < (7, 3):
alt = "Logo"
else:
alt = "Logo of Python"

chunks = [
'<h1>Page not found</h1>',
"Unfortunately we couldn't find the content you were looking for.",
'<title>Page not found &#8212; Python documentation</title>',

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

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

if sphinx.version_info < (7, 3):
alt = "Logo"
else:
alt = "Logo of Python"

chunks = [
# sidebar URLs
'<h1 class="logo"><a href="/language/version/index.html">Python</a></h1>',
Expand All @@ -147,7 +157,7 @@ def test_urls_prefix_setting(app, status, warning):

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

# resources
_get_css_html_link_tag(app, 'language', 'version', 'alabaster.css'),
Expand Down Expand Up @@ -177,6 +187,12 @@ def test_urls_prefix_setting_none(app, status, warning):
else:
cssclass = ""

if sphinx.version_info < (7, 3):
alt = "Logo"
else:
alt = "Logo of Python"


chunks = [
# sidebar URLs
'<h1 class="logo"><a href="/index.html">Python</a></h1>',
Expand All @@ -185,7 +201,7 @@ def test_urls_prefix_setting_none(app, status, warning):

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

# resources
_get_css_html_link_tag(app, '', '', 'alabaster.css'),
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ isolated_build = True

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

[testenv]
deps =
Expand All @@ -15,7 +17,9 @@ deps =
sphinx5: sphinx<6.0
sphinx6: sphinx<7.0
sphinx7: sphinx<8.0
sphinx8: sphinx<9.0
sphinxlatest: sphinx
sphinxdev: https://github.com/sphinx-doc/sphinx/archive/refs/heads/master.zip
commands = pytest {posargs}

[testenv:docs]
Expand Down