Skip to content

Commit

Permalink
Merge pull request #88 from readthedocs/humitos/more-tests
Browse files Browse the repository at this point in the history
Add more test environments
  • Loading branch information
humitos committed Apr 11, 2020
2 parents cb9d16a + 799b67b commit f421525
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python:
- 2.7
- 3.6
- 3.7
- 3.8
install:
pip install tox-travis
script:
Expand Down
32 changes: 23 additions & 9 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,31 @@ def test_sphinx_resource_urls(app, status, warning):

content = open(path).read()

chunks = [
# Sphinx's resources URLs
'<script type="text/javascript" src="/en/latest/_static/jquery.js"></script>',
'<script type="text/javascript" src="/en/latest/_static/underscore.js"></script>',
'<script type="text/javascript" src="/en/latest/_static/doctools.js"></script>',
]
if sphinx.version_info < (2, 4, 0):
chunks = [
# Sphinx's resources URLs
'<script type="text/javascript" src="/en/latest/_static/jquery.js"></script>',
'<script type="text/javascript" src="/en/latest/_static/underscore.js"></script>',
'<script type="text/javascript" src="/en/latest/_static/doctools.js"></script>',
]
else:
# #6925: html: Remove redundant type="text/javascript" from <script> elements
chunks = [
# Sphinx's resources URLs
'<script src="/en/latest/_static/jquery.js"></script>',
'<script src="/en/latest/_static/underscore.js"></script>',
'<script src="/en/latest/_static/doctools.js"></script>',
]

if sphinx.version_info >= (1, 8):
chunks.append(
'<script type="text/javascript" src="/en/latest/_static/language_data.js"></script>',
)
if sphinx.version_info < (2, 4, 0):
chunks.append(
'<script type="text/javascript" src="/en/latest/_static/language_data.js"></script>',
)
else:
chunks.append(
'<script src="/en/latest/_static/language_data.js"></script>',
)

for chunk in chunks:
assert chunk in content
Expand Down
17 changes: 10 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
envlist =
docs
py27-sphinx{17,18}
py{36,37}-sphinx{17,18,20,21,22}
py{36,37,38}-sphinx{17,18,20,21,22,23,24,30}

[testenv]
deps =
pytest
pdbpp
.
sphinx17: sphinx==1.7.9
sphinx18: sphinx==1.8.5
sphinx20: sphinx==2.0.1
sphinx21: sphinx==2.1.2
sphinx22: sphinx==2.2.0
sphinx17: sphinx~=1.7.0
sphinx18: sphinx~=1.8.0
sphinx20: sphinx~=2.0.0
sphinx21: sphinx~=2.1.0
sphinx22: sphinx~=2.2.0
sphinx23: sphinx~=2.3.0
sphinx24: sphinx~=2.4.0
sphinx30: sphinx~=3.0.0
commands = pytest {posargs}

[testenv:py37-sphinx21]
[testenv:py38-sphinx30]
deps =
{[testenv]deps}
pytest-cov
Expand Down

0 comments on commit f421525

Please sign in to comment.