readthedocs / sphinx-notfound-page

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

0.8.3: looks like `notfound` is not ready for sphinx >= 6.1.3 #217

Closed kloczek closed 12 months ago

kloczek commented 1 year ago

Look lik after upgrade to latest sphinx 6.1.4 pytest started failing

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-notfound-page-0.8.3-7.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-notfound-page-0.8.3-7.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ============================= test session starts ============================== platform linux -- Python 3.8.16, pytest-7.2.2, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-0.8.3, configfile: pytest.ini collected 30 items tests/test_urls.py ..F..FF.FF.........F.......x.. [100%] =================================== FAILURES =================================== ____________________________ test_default_settings _____________________________ app = status = <_io.StringIO object at 0x7fea10d79ee0> warning = <_io.StringIO object at 0x7fea10d79e50> @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() chunks = [ '

Page not found

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

Python

', '
\n\n \n\n \n \n' tests/test_urls.py:81: AssertionError --------------------------- Captured stdout teardown --------------------------- # testroot: root # builder: html # srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-0.8.3/tests/examples/default # outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-0.8.3/tests/examples/default/_build/html # status: Running Sphinx v6.1.3 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 writing output... [100%] index generating indices... genindex done writing additional pages... search done copying static files... done copying extra files... 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_default_language_setting _________________________ app = status = <_io.StringIO object at 0x7fea10b25a60> warning = <_io.StringIO object at 0x7fea10b25f70> @pytest.mark.sphinx( srcdir=srcdir, confoverrides={ 'notfound_default_language': 'ja', }, ) def test_default_language_setting(app, status, warning): app.build() path = app.outdir / '404.html' assert path.exists() content = open(path).read() chunks = [ # sidebar URLs '

Python

', '', '
  • Documentation overview
      ', # favicon and logo '', '', # resources _get_css_html_link_tag('ja', 'latest', 'alabaster.css'), _get_css_html_link_tag('ja', 'latest', 'pygments.css'), '', ] for chunk in chunks: > assert chunk in content E assert '' in '\n\n\n\n \n \n Alabaster 0.7.13\n \n
  • \n\n \n\n \n \n' tests/test_urls.py:148: AssertionError --------------------------- Captured stdout teardown --------------------------- # testroot: root # builder: html # srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-0.8.3/tests/examples/default # outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-0.8.3/tests/examples/default/_build/html # status: Running Sphinx v6.1.3 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 writing output... [100%] index generating indices... genindex done writing additional pages... search done copying static files... done copying extra files... 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_default_version_setting _________________________ app = status = <_io.StringIO object at 0x7fea10c44430> warning = <_io.StringIO object at 0x7fea10c44280> @pytest.mark.sphinx( srcdir=srcdir, confoverrides={ 'notfound_default_version': 'customversion', }, ) def test_default_version_setting(app, status, warning): app.build() path = app.outdir / '404.html' assert path.exists() content = open(path).read() chunks = [ # sidebar URLs '

    Python

    ', '', '
  • Documentation overview