readthedocs / sphinx-notfound-page

Create a custom 404 page with absolute URLs hardcoded
https://sphinx-notfound-page.readthedocs.io/
MIT License
48 stars 31 forks source link

1.0.0: pytest fails with sphinx 7.2.x #229

Open kloczek opened 4 months ago

kloczek commented 4 months ago

Looks like test suite fails in 6 units

Here is pytest output: ```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-notfound-page-1.0.0-4.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-notfound-page-1.0.0-4.fc36.x86_64/usr/lib/python3.9/site-packages + /usr/bin/pytest -ra -m 'not network' ============================= test session starts ============================== platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0 rootdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.0 configfile: pytest.ini collected 20 items tests/test_urls.py ..F..FF.F...F.F..... [100%] =================================== FAILURES =================================== ____________________________ test_default_settings _____________________________ app = status = <_io.StringIO object at 0x7f77be8fe280> warning = <_io.StringIO object at 0x7f77be8fe1f0> @pytest.mark.sphinx(srcdir=srcdir) def test_default_settings(app, status, warning): app.build() path = app.outdir / '404.html' assert path.exists() content = open(path).read() if sphinx.version_info < (6, 0): cssclass = "shortcut " else: cssclass = "" chunks = [ '

Page not found

', "Unfortunately we couldn't find the content you were looking for.", 'Page not found — Python documentation', # favicon and logo f'', '', # sidebar URLs '

Python

', '
\n\n \n\n \n \n' tests/test_urls.py:83: AssertionError --------------------------- Captured stdout teardown --------------------------- # testroot: root # builder: html # srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.0/tests/examples/default # outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.0/tests/examples/default/_build/html # status: Running Sphinx v7.2.6 building [mo]: targets for 0 po files that are out of date writing output... building [html]: targets for 3 source files that are out of date updating environment: [new config] 3 added, 0 changed, 0 removed reading sources... [100%] index looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done copying assets... copying static files... done copying extra files... done done writing output... [100%] index generating indices... genindex done writing additional pages... search done dumping search index in English (code: en)... done dumping object inventory... done build succeeded. The HTML pages are in tests/examples/default/_build/html. # warning: ___________________________ test_urls_prefix_setting ___________________________ app = status = <_io.StringIO object at 0x7f77be821040> warning = <_io.StringIO object at 0x7f77be7f3af0> @pytest.mark.sphinx( srcdir=srcdir, confoverrides={ 'notfound_urls_prefix': '/language/version/', }, ) def test_urls_prefix_setting(app, status, warning): app.build() path = app.outdir / '404.html' assert path.exists() content = open(path).read() if sphinx.version_info < (6, 0): cssclass = "shortcut " else: cssclass = "" chunks = [ # sidebar URLs '

Python

', '', '
  • Documentation overview
      ', # favicon and logo f'', '', # resources _get_css_html_link_tag('language', 'version', 'alabaster.css'), _get_css_html_link_tag('language', 'version', 'pygments.css'), '', ] for chunk in chunks: > assert chunk in content E assert '' in '\n\n\n \n \n Alabaster 0.7.16\n \n
  • \n\n \n\n \n \n' tests/test_urls.py:154: AssertionError --------------------------- Captured stdout teardown --------------------------- # testroot: root # builder: html # srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.0/tests/examples/default # outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.0/tests/examples/default/_build/html # status: Running Sphinx v7.2.6 building [mo]: targets for 0 po files that are out of date writing output... building [html]: targets for 3 source files that are out of date updating environment: [new config] 3 added, 0 changed, 0 removed reading sources... [100%] index looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done copying assets... copying static files... done copying extra files... done done writing output... [100%] index generating indices... genindex done writing additional pages... search done dumping search index in English (code: en)... done dumping object inventory... done build succeeded. The HTML pages are in tests/examples/default/_build/html. # warning: ________________________ test_urls_prefix_setting_none _________________________ app = status = <_io.StringIO object at 0x7f77be772430> warning = <_io.StringIO object at 0x7f77be772040> @pytest.mark.sphinx( srcdir=srcdir, confoverrides={ 'notfound_urls_prefix': None, }, ) def test_urls_prefix_setting_none(app, status, warning): app.build() path = app.outdir / '404.html' assert path.exists() content = open(path).read() if sphinx.version_info < (6, 0): cssclass = "shortcut " else: cssclass = "" chunks = [ # sidebar URLs '

    Python

    ', '', '
  • Documentation overview