Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.4: pytest fails in 8 units #249

Open
kloczek opened this issue Oct 24, 2024 · 0 comments
Open

1.0.4: pytest fails in 8 units #249

kloczek opened this issue Oct 24, 2024 · 0 comments

Comments

@kloczek
Copy link
Contributor

kloczek commented Oct 24, 2024

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix> using installer module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-notfound-page-1.0.4-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-notfound-page-1.0.4-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4
configfile: pytest.ini
collected 21 items

tests/test_urls.py ...F..FF.F...F.FFF...                                 [100%]

=================================== FAILURES ===================================
____________________________ test_default_settings _____________________________

app = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7f0899175a20>
warning = <_io.StringIO object at 0x7f0899175b40>

    @pytest.mark.sphinx(srcdir=srcdir)
    def test_default_settings(app, status, warning):
        app.build()
        path = app.outdir / '404.html'
        assert path.exists()
        content = path.read_text()

        if sphinx.version_info < (6, 0):
            cssclass = "shortcut "
        else:
            cssclass = ""

        if sphinx.version_info < (7, 3):
            alt = "Logo"
        else:
            alt = "Logo of Python"

        chunks = [
            '<h1>Page not found</h1>',
            "Unfortunately we couldn't find the content you were looking for.",
            '<title>Page not found &#8212; Python  documentation</title>',

            # favicon and logo
            f'<link rel="{cssclass}icon" href="/en/latest/_static/favicon.png"/>',
            f'<img class="logo" src="/en/latest/_static/logo.svg" alt="{alt}"/>',

            # sidebar URLs
            '<h1 class="logo"><a href="/en/latest/index.html">Python</a></h1>',
            '<form class="search" action="/en/latest/search.html" method="get">',
            '<li><a href="/en/latest/index.html">Documentation overview</a><ul>',

            # resources
            _get_css_html_link_tag(app, 'en', 'latest', 'alabaster.css'),
            _get_css_html_link_tag(app, 'en', 'latest', 'pygments.css'),
            '<link rel="stylesheet" href="/en/latest/_static/custom.css" type="text/css" />',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<h1 class="logo"><a href="/en/latest/index.html">Python</a></h1>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="./">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="v...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:93: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html
# status:
Running Sphinx v8.1.3
loading translations [en]... done
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... [ 33%] chapter
reading sources... [ 67%] chapter-i
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 33%] chapter
writing output... [ 67%] chapter-i
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 = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7f089908b0a0>
warning = <_io.StringIO object at 0x7f089908b010>

    @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 = path.read_text()

        if sphinx.version_info < (6, 0):
            cssclass = "shortcut "
        else:
            cssclass = ""

        if sphinx.version_info < (7, 3):
            alt = "Logo"
        else:
            alt = "Logo of Python"

        chunks = [
            # sidebar URLs
            '<h1 class="logo"><a href="/language/version/index.html">Python</a></h1>',
            '<form class="search" action="/language/version/search.html" method="get">',
            '<li><a href="/language/version/index.html">Documentation overview</a><ul>',

            # favicon and logo
            f'<link rel="{cssclass}icon" href="/language/version/_static/favicon.png"/>',
            f'<img class="logo" src="/language/version/_static/logo.svg" alt="{alt}"/>',

            # resources
            _get_css_html_link_tag(app, 'language', 'version', 'alabaster.css'),
            _get_css_html_link_tag(app, 'language', 'version', 'pygments.css'),
            '<link rel="stylesheet" href="/language/version/_static/custom.css" type="text/css" />',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<h1 class="logo"><a href="/language/version/index.html">Python</a></h1>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="./">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="v...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:169: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html
# status:
Running Sphinx v8.1.3
loading translations [en]... done
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... [ 33%] chapter
reading sources... [ 67%] chapter-i
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 33%] chapter
writing output... [ 67%] chapter-i
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 = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7f089908a290>
warning = <_io.StringIO object at 0x7f08990db400>

    @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 = path.read_text()

        if sphinx.version_info < (6, 0):
            cssclass = "shortcut "
        else:
            cssclass = ""

        if sphinx.version_info < (7, 3):
            alt = "Logo"
        else:
            alt = "Logo of Python"


        chunks = [
            # sidebar URLs
            '<h1 class="logo"><a href="/index.html">Python</a></h1>',
            '<form class="search" action="/search.html" method="get">',
            '<li><a href="/index.html">Documentation overview</a><ul>',

            # favicon and logo
            f'<link rel="{cssclass}icon" href="/_static/favicon.png"/>',
            f'<img class="logo" src="/_static/logo.svg" alt="{alt}"/>',

            # resources
            _get_css_html_link_tag(app, '', '', 'alabaster.css'),
            _get_css_html_link_tag(app, '', '', 'pygments.css'),
            '<link rel="stylesheet" href="/_static/custom.css" type="text/css" />',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<h1 class="logo"><a href="/index.html">Python</a></h1>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="./">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="v...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:213: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html
# status:
Running Sphinx v8.1.3
loading translations [en]... done
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... [ 33%] chapter
reading sources... [ 67%] chapter-i
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 33%] chapter
writing output... [ 67%] chapter-i
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_custom_404_rst_source __________________________

app = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7f0898f1b1c0>
warning = <_io.StringIO object at 0x7f0898f1b130>

    @pytest.mark.sphinx(
        srcdir=rstsrcdir,
        confoverrides={
            'version': '2.5.1',
        },
    )
    def test_custom_404_rst_source(app, status, warning):
        app.build()
        path = app.outdir / '404.html'
        assert path.exists()

        content = path.read_text()

        chunks = [
            # custom 404.rst file content
            '<title>Oh, oh - Page not found &#8212; Python  documentation</title>',
            '<p>This is a custom 404.rst file.</p>',
            '<p>This file should be rendered instead of the default one.</p>',
            "<p>Variables Sphinx substitution should be allowed here.\nExample, version: 2.5.1.</p>",

            # sidebar URLs
            '<h1 class="logo"><a href="/en/latest/index.html">Python</a></h1>',
            '<form class="search" action="/en/latest/search.html" method="get">',
            '<li><a href="/en/latest/index.html">Documentation overview</a><ul>',

            # resources
            _get_css_html_link_tag(app, 'en', 'latest', 'alabaster.css'),
            _get_css_html_link_tag(app, 'en', 'latest', 'pygments.css'),
            '<link rel="stylesheet" href="/en/latest/_static/custom.css" type="text/css" />',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<h1 class="logo"><a href="/en/latest/index.html">Python</a></h1>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="./">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="v...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:279: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/404rst
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/404rst/_build/html
# status:
Running Sphinx v8.1.3
loading translations [en]... done
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [ 50%] 404
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/404rst/_build/html/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/404rst/_build/html/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/404rst/_build/html/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 50%] 404
writing output... [100%] index

generating indices... genindex done
writing additional pages... search done
copying images... [ 33%] test.png
copying images... [ 67%] images/loudly-crying-face.png
copying images... [100%] https.png

dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in tests/examples/404rst/_build/html.

# warning:

________________________ test_urls_for_dirhtml_builder _________________________

app = <SphinxTestApp buildername='dirhtml'>
status = <_io.StringIO object at 0x7f0898d2e680>
warning = <_io.StringIO object at 0x7f0898d2e710>

    @pytest.mark.sphinx(
        srcdir=srcdir,
        buildername='dirhtml',
    )
    def test_urls_for_dirhtml_builder(app, status, warning):
        app.build()
        path = app.outdir / '404' / 'index.html'
        assert path.exists()

        content = path.read_text()

        chunks = [
            # sidebar URLs
            '<form class="search" action="/en/latest/search/" method="get">',
            '<li class="toctree-l1"><a class="reference internal" href="/en/latest/chapter/">Chapter</a></li>',

            # resources
            _get_css_html_link_tag(app, 'en', 'latest', 'alabaster.css'),
            _get_css_html_link_tag(app, 'en', 'latest', 'pygments.css'),
            '<link rel="stylesheet" href="/en/latest/_static/custom.css" type="text/css" />',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<li class="toctree-l1"><a class="reference internal" href="/en/latest/chapter/">Chapter</a></li>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="../">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:382: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: dirhtml
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/dirhtml
# status:
Running Sphinx v8.1.3
loading translations [en]... done
building [mo]: targets for 0 po files that are out of date
writing output...
building [dirhtml]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [ 33%] chapter
reading sources... [ 67%] chapter-i
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/dirhtml/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/dirhtml/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/dirhtml/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 33%] chapter
writing output... [ 67%] chapter-i
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/dirhtml.

# warning:

______________________ test_toctree_urls_notfound_default ______________________

app = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7f0898fa4160>
warning = <_io.StringIO object at 0x7f0898fa4280>

    @pytest.mark.sphinx(
        srcdir=srcdir,
        confoverrides={
            'notfound_urls_prefix': '/ja/default/',
        },
    )
    def test_toctree_urls_notfound_default(app, status, warning):
        app.build()
        path = app.outdir / '404.html'
        assert path.exists()

        content = path.read_text()

        chunks = [
            # sidebar URLs
            '<form class="search" action="/ja/default/search.html" method="get">',
            '<li class="toctree-l1"><a class="reference internal" href="/ja/default/chapter.html">Chapter</a></li>',

            # resources
            _get_css_html_link_tag(app, 'ja', 'default', 'alabaster.css'),
            _get_css_html_link_tag(app, 'ja', 'default', 'pygments.css'),
            '<link rel="stylesheet" href="/ja/default/_static/custom.css" type="text/css" />',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<li class="toctree-l1"><a class="reference internal" href="/ja/default/chapter.html">Chapter</a></li>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="./">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="v...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:433: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html
# status:
Running Sphinx v8.1.3
loading translations [en]... done
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... [ 33%] chapter
reading sources... [ 67%] chapter-i
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 33%] chapter
writing output... [ 67%] chapter-i
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_toctree_links ______________________________

app = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7f0898f1a680>
warning = <_io.StringIO object at 0x7f0898f19090>

    @pytest.mark.sphinx(
        srcdir=srcdir,
    )
    def test_toctree_links(app, status, warning):
        app.build()
        path = app.outdir / '404.html'
        assert path.exists()

        content = path.read_text()

        chunks = [
            '<h3>Navigation</h3>',
            '<li class="toctree-l1"><a class="reference internal" href="/en/latest/chapter-i.html">Chapter I</a></li>',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<li class="toctree-l1"><a class="reference internal" href="/en/latest/chapter-i.html">Chapter I</a></li>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="./">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="v...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:452: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html
# status:
Running Sphinx v8.1.3
loading translations [en]... done
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... [ 33%] chapter
reading sources... [ 67%] chapter-i
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 33%] chapter
writing output... [ 67%] chapter-i
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_toctree_links_custom_settings ______________________

app = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7f08990b28c0>
warning = <_io.StringIO object at 0x7f08990b2a70>

    @pytest.mark.sphinx(
        srcdir=srcdir,
        confoverrides={
            'notfound_urls_prefix': '/pt-br/stable/',
        },
    )
    def test_toctree_links_custom_settings(app, status, warning):
        app.build()
        path = app.outdir / '404.html'
        assert path.exists()

        content = path.read_text()

        chunks = [
            '<h3>Navigation</h3>',
            '<li class="toctree-l1"><a class="reference internal" href="/pt-br/stable/chapter-i.html">Chapter I</a></li>',
        ]

        for chunk in chunks:
>           assert chunk in content
E           assert '<li class="toctree-l1"><a class="reference internal" href="/pt-br/stable/chapter-i.html">Chapter I</a></li>' in '<!DOCTYPE html>\n\n<html lang="en" data-content_root="./">\n  <head>\n    <meta charset="utf-8" />\n    <meta name="v...pyright .\n      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.\n    </div>\n  </body>\n</html>'

tests/test_urls.py:474: AssertionError
--------------------------- Captured stdout teardown ---------------------------
# testroot: root
# builder: html
# srcdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default
# outdir: /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html
# status:
Running Sphinx v8.1.3
loading translations [en]... done
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... [ 33%] chapter
reading sources... [ 67%] chapter-i
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...
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/basic.css
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/documentation_options.js
Writing evaluated template result to /home/tkloczko/rpmbuild/BUILD/sphinx-notfound-page-1.0.4/tests/examples/default/_build/html/_static/language_data.js
copying static files: done
copying extra files...
copying extra files: done
copying assets: done
writing output... [ 33%] chapter
writing output... [ 67%] chapter-i
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:

=========================== short test summary info ============================
FAILED tests/test_urls.py::test_default_settings - assert '<h1 class="logo"><...
FAILED tests/test_urls.py::test_urls_prefix_setting - assert '<h1 class="logo...
FAILED tests/test_urls.py::test_urls_prefix_setting_none - assert '<h1 class=...
FAILED tests/test_urls.py::test_custom_404_rst_source - assert '<h1 class="lo...
FAILED tests/test_urls.py::test_urls_for_dirhtml_builder - assert '<li class=...
FAILED tests/test_urls.py::test_toctree_urls_notfound_default - assert '<li c...
FAILED tests/test_urls.py::test_toctree_links - assert '<li class="toctree-l1...
FAILED tests/test_urls.py::test_toctree_links_custom_settings - assert '<li c...
========================= 8 failed, 13 passed in 4.35s =========================
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-310b59c6-00d8-4acd-9c59-0ec1370f88f1/test_discovery_via_path_in_non0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_discovery_via_path_in_non0'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-310b59c6-00d8-4acd-9c59-0ec1370f88f1
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-310b59c6-00d8-4acd-9c59-0ec1370f88f1'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1d65d035-4651-4eb6-82a9-7112c404ea4b/test_discovery_via_path_in_non0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_discovery_via_path_in_non0'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1d65d035-4651-4eb6-82a9-7112c404ea4b
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-1d65d035-4651-4eb6-82a9-7112c404ea4b'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-42daa8d7-4ea2-4fa1-9d7d-99047064f405/test_static_directory_without_0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_static_directory_without_0'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-42daa8d7-4ea2-4fa1-9d7d-99047064f405/test_static_directory_without_1
<class 'OSError'>: [Errno 39] Directory not empty: 'test_static_directory_without_1'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-42daa8d7-4ea2-4fa1-9d7d-99047064f405
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-42daa8d7-4ea2-4fa1-9d7d-99047064f405'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-99c46a03-3c3f-4dfc-ae92-8505e45a2465/test_static_directory_without_0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_static_directory_without_0'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-99c46a03-3c3f-4dfc-ae92-8505e45a2465/test_static_directory_without_1
<class 'OSError'>: [Errno 39] Directory not empty: 'test_static_directory_without_1'
  warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-99c46a03-3c3f-4dfc-ae92-8505e45a2465
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-99c46a03-3c3f-4dfc-ae92-8505e45a2465'
  warnings.warn(
List of installed modules in build env:
Package                       Version
----------------------------- -----------
alabaster                     0.7.16
astroid                       3.3.5
babel                         2.16.0
build                         1.2.2.post1
charset-normalizer            3.4.0
defusedxml                    0.7.1
distro                        1.9.0
docutils                      0.21.2
exceptiongroup                1.1.3
imagesize                     1.4.1
importlib_metadata            8.5.0
iniconfig                     2.0.0
installer                     0.7.0
Jinja2                        3.1.4
MarkupSafe                    3.0.2
packaging                     24.0
pluggy                        1.5.0
Pygments                      2.18.0
pyproject_hooks               1.2.0
pytest                        8.2.2
python-dateutil               2.9.0.post0
PyYAML                        6.0.2
requests                      2.32.3
setuptools                    75.1.0
snowballstemmer               2.2.0
Sphinx                        8.1.3
sphinx-autoapi                3.3.2
sphinx-prompt                 1.6.0
sphinx-tabs                   3.4.7
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-devhelp         1.0.6
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 2.0.0
sphinxemoji                   0.2.0
tokenize_rt                   6.1.0
tomli                         2.0.1
typing_extensions             4.12.2
urllib3                       2.2.2
wheel                         0.44.0
zipp                          3.20.2

Please let me know if you need more details or want me to perform some diagnostics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant