Closed
Description
We see the following tests fail with on numpydoc 1.2.1 with Sphinx 4.5.0 and Jinja 3.1.1.
_______________________________ test_my_function _______________________________
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
def test_my_function(sphinx_app):
"""Test that function documentation is reasonable."""
out_dir = sphinx_app.outdir
function_html = op.join(out_dir, 'generated',
'numpydoc_test_module.my_function.html')
with open(function_html, 'r') as fid:
html = fid.read()
assert r'\*args' not in html
assert '*args' in html
# check xref (iterable should link using xref):
> assert 'glossary.html#term-iterable' in html
E assert 'glossary.html#term-iterable' in '\n<!DOCTYPE html>\n\n<html>\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-..._module.my_function.rst.txt"\n rel="nofollow">Page source</a>\n </div>\n\n \n\n \n </body>\n</html>'
fid = <_io.TextIOWrapper name='/build/pytest-of-nixbld/pytest-0/root/_build/html/generated/numpydoc_test_module.my_function.html' mode='r' encoding='UTF-8'>
function_html = '/build/pytest-of-nixbld/pytest-0/root/_build/html/generated/numpydoc_test_module.my_function.html'
html = '\n<!DOCTYPE html>\n\n<html>\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-..._module.my_function.rst.txt"\n rel="nofollow">Page source</a>\n </div>\n\n \n\n \n </body>\n</html>'
out_dir = '/build/pytest-of-nixbld/pytest-0/root/_build/html'
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
numpydoc/tests/test_full.py:74: AssertionError
_________________________ test_reference[html_file0-1] _________________________
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
html_file = ['index.html'], expected_length = 1
@pytest.mark.parametrize(("html_file", "expected_length"), (
(["index.html"], 1),
(["generated", "numpydoc_test_module.my_function.html"], 1),
(["generated", "numpydoc_test_module.MyClass.html"], 1),
))
def test_reference(sphinx_app, html_file, expected_length):
"""Test for bad references"""
out_dir = sphinx_app.outdir
with open(op.join(out_dir, *html_file), 'r') as fid:
html = fid.read()
reference_list = re.findall(r'<a class="fn-backref" href="\#id\d+">(.*)<\/a>', html)
> assert len(reference_list) == expected_length
E assert 0 == 1
E + where 0 = len([])
expected_length = 1
fid = <_io.TextIOWrapper name='/build/pytest-of-nixbld/pytest-0/root/_build/html/index.html' mode='r' encoding='UTF-8'>
html = '\n<!DOCTYPE html>\n\n<html>\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-...ref="_sources/index.rst.txt"\n rel="nofollow">Page source</a>\n </div>\n\n \n\n \n </body>\n</html>'
html_file = ['index.html']
out_dir = '/build/pytest-of-nixbld/pytest-0/root/_build/html'
reference_list = []
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
numpydoc/tests/test_full.py:91: AssertionError
_________________________ test_reference[html_file1-1] _________________________
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
html_file = ['generated', 'numpydoc_test_module.my_function.html']
expected_length = 1
@pytest.mark.parametrize(("html_file", "expected_length"), (
(["index.html"], 1),
(["generated", "numpydoc_test_module.my_function.html"], 1),
(["generated", "numpydoc_test_module.MyClass.html"], 1),
))
def test_reference(sphinx_app, html_file, expected_length):
"""Test for bad references"""
out_dir = sphinx_app.outdir
with open(op.join(out_dir, *html_file), 'r') as fid:
html = fid.read()
reference_list = re.findall(r'<a class="fn-backref" href="\#id\d+">(.*)<\/a>', html)
> assert len(reference_list) == expected_length
E assert 0 == 1
E + where 0 = len([])
expected_length = 1
fid = <_io.TextIOWrapper name='/build/pytest-of-nixbld/pytest-0/root/_build/html/generated/numpydoc_test_module.my_function.html' mode='r' encoding='UTF-8'>
html = '\n<!DOCTYPE html>\n\n<html>\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-..._module.my_function.rst.txt"\n rel="nofollow">Page source</a>\n </div>\n\n \n\n \n </body>\n</html>'
html_file = ['generated', 'numpydoc_test_module.my_function.html']
out_dir = '/build/pytest-of-nixbld/pytest-0/root/_build/html'
reference_list = []
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
numpydoc/tests/test_full.py:91: AssertionError
_________________________ test_reference[html_file2-1] _________________________
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
html_file = ['generated', 'numpydoc_test_module.MyClass.html']
expected_length = 1
@pytest.mark.parametrize(("html_file", "expected_length"), (
(["index.html"], 1),
(["generated", "numpydoc_test_module.my_function.html"], 1),
(["generated", "numpydoc_test_module.MyClass.html"], 1),
))
def test_reference(sphinx_app, html_file, expected_length):
"""Test for bad references"""
out_dir = sphinx_app.outdir
with open(op.join(out_dir, *html_file), 'r') as fid:
html = fid.read()
reference_list = re.findall(r'<a class="fn-backref" href="\#id\d+">(.*)<\/a>', html)
> assert len(reference_list) == expected_length
E assert 0 == 1
E + where 0 = len([])
expected_length = 1
fid = <_io.TextIOWrapper name='/build/pytest-of-nixbld/pytest-0/root/_build/html/generated/numpydoc_test_module.MyClass.html' mode='r' encoding='UTF-8'>
html = '\n<!DOCTYPE html>\n\n<html>\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-...test_module.MyClass.rst.txt"\n rel="nofollow">Page source</a>\n </div>\n\n \n\n \n </body>\n</html>'
html_file = ['generated', 'numpydoc_test_module.MyClass.html']
out_dir = '/build/pytest-of-nixbld/pytest-0/root/_build/html'
reference_list = []
sphinx_app = <sphinx.application.Sphinx object at 0x7ffff588c1c0>
numpydoc/tests/test_full.py:91: AssertionError
Metadata
Metadata
Assignees
Labels
No labels