mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Remove pytest warnings (#1515)
* Remove pytest warnings
Ignore deprecations on Sphinx 9.0 that comes from readthedocs-sphinx-ext and use
`findall()` instead of `.traverse()` as suggested by docutils.
* We can't ignore a warning from Sphinx 9.0
We are testing in older versions where this exception is not defined.
The deprecation warning we are seeing here is not related to `sphinx_rtd_theme`
but with `readthedocs-sphinx-ext` because at:
13edf78bab/readthedocs_ext/readthedocs.py (L118-L122)
In any case, we will stop using that Sphinx extension at some point.
This commit is contained in:
parent
2da37d6afd
commit
17111add80
5
pytest.ini
Normal file
5
pytest.ini
Normal file
@ -0,0 +1,5 @@
|
||||
[pytest]
|
||||
filterwarnings =
|
||||
# Ignore external dependencies warning deprecations
|
||||
# Sphinx
|
||||
# ignore::sphinx.deprecation.RemovedInSphinx90Warning
|
@ -18,7 +18,7 @@ from .util import build_all
|
||||
|
||||
def test_basic():
|
||||
for (app, status, warning) in build_all('test-basic'):
|
||||
assert app.env.get_doctree('index').traverse(addnodes.toctree)
|
||||
assert app.env.get_doctree('index').findall(addnodes.toctree)
|
||||
content = open(os.path.join(app.outdir, 'index.html')).read()
|
||||
|
||||
if isinstance(app.builder, DirectoryHTMLBuilder):
|
||||
@ -66,7 +66,7 @@ def test_basic():
|
||||
def test_empty():
|
||||
"""Local TOC is showing, as toctree was empty"""
|
||||
for (app, status, warning) in build_all('test-empty'):
|
||||
assert app.env.get_doctree('index').traverse(addnodes.toctree)
|
||||
assert app.env.get_doctree('index').findall(addnodes.toctree)
|
||||
content = open(os.path.join(app.outdir, 'index.html')).read()
|
||||
global_toc = '<div class="toctree-wrapper compound">\n</div>'
|
||||
local_toc = (
|
||||
@ -81,7 +81,7 @@ def test_empty():
|
||||
def test_missing_toctree():
|
||||
"""Local TOC is showing, as toctree was missing"""
|
||||
for (app, status, warning) in build_all('test-missing-toctree'):
|
||||
assert app.env.get_doctree('index').traverse(addnodes.toctree) == []
|
||||
assert list(app.env.get_doctree('index').findall(addnodes.toctree)) == []
|
||||
content = open(os.path.join(app.outdir, 'index.html')).read()
|
||||
assert '<div class="toctree' not in content
|
||||
assert '<div class="local-toc">' in content
|
||||
|
Loading…
Reference in New Issue
Block a user