Skip to content

Commit

Permalink
Tests: update test suite and fix some tests (#242)
Browse files Browse the repository at this point in the history
* Update Git ignore

* 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.
  • Loading branch information
humitos authored Jul 31, 2024
1 parent c628442 commit fe10592
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
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

0 comments on commit fe10592

Please sign in to comment.