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

test_basic fails with Sphinx-7.3.7 #1558

Open
heirecka opened this issue Apr 19, 2024 · 0 comments
Open

test_basic fails with Sphinx-7.3.7 #1558

heirecka opened this issue Apr 19, 2024 · 0 comments
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@heirecka
Copy link

Problem

tests/test_builders.py::test_basic fails with Sphinx 7.3.7 whereas it didn't fail with 7.2.6. From a superficial look it seems like the file part (index.html) is omitted now and only the anchor #document-foo remains, triggering the assert.

Error Logs/Results

==================================================================================== FAILURES =====================================================================================
___________________________________________________________________________________ test_basic ____________________________________________________________________________________

    def test_basic():
        for (app, status, warning) in build_all('test-basic'):
            assert app.env.get_doctree('index').traverse(addnodes.toctree)
            content = open(os.path.join(app.outdir, 'index.html')).read()
    
            if isinstance(app.builder, DirectoryHTMLBuilder):
                search = (
                    '<div class="toctree-wrapper compound">\n'
                    '<ul>\n'
                    '<li class="toctree-l1">'
                    '<a class="reference internal" href="foo/">foo</a>'
                    '<ul>\n'
                    '<li class="toctree-l2">'
                    '<a class="reference internal" href="bar/">bar</a></li>\n'
                    '</ul>\n'
                    '</li>\n'
                    '</ul>\n'
                    '</div>'
                )
                assert search in content
            elif isinstance(app.builder, SingleFileHTMLBuilder):
                search = (
                    '<ul>\n'
                    '<li class="toctree-l1">'
                    '<a class="reference internal" href="index.html#document-foo">foo</a>'
                    '</li>\n'
                    '</ul>'
                )
>               assert search in content
E               assert '<ul>\n<li class="toctree-l1"><a class="reference internal" href="index.html#document-foo">foo</a></li>\n</ul>' in '<!DOCTYPE html>\n<html class="writer-html5" lang="en" data-content_root="./">\n<head>\n  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />\n\n  <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n  <title>Python documentation</title>\n      <link rel="stylesheet" type="text/css" href="_static/pygments.css" />\n      <link rel="stylesheet" type="text/css" href="_static/css/theme.css" />\n      <link rel="stylesheet" type="text/css" href="https://assets.readthedocs.org/static/css/badge_only.css" />\n\n  \n  <!--[if lt IE 9]>\n    <script src="_static/js/html5shiv.min.js"></script>\n  <![endif]-->\n  \n        <script src="_static/jquery.js?v=5d32c60e"></script>\n        <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>\n        <script src="_static/documentation_options.js"></script>\n        <script src="_static/doctools.js"></script>\n        <script src="_static/sphinx_highlight.js"></script>\n        <script async="async" src="https://assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js"></script>\n    <script src="_static/js/theme.js"></script>\n    <link rel="index" title="Index" href="genindex.html" />\n    <link rel="search" title="Search" href="search.html" /> \n\n<!-- RTD Extra Head -->\n\n<link rel="stylesheet" href="https://assets.readthedocs.org/static/css/readthedocs-doc-embed.css" type="text/css" />\n\n<script type="application/json" id="READTHEDOCS_DATA">{"ad_free": "", "api_host": "", "builder": "sphinx", "canonical_url": "", "docroot": "", "features": {"docsearch_disabled": false}, "global_analytics_code": null, "language": "", "page": "index", "programming_language": "", "project": "", "source_suffix": "", "subprojects": {}, "theme": "", "user_analytics_code": null, "version": ""}</script>\n\n<!--\nUsing this variable directly instead of using `JSON.parse` is deprecated.\nThe READTHEDOCS_DATA global variable will be removed in the future.\n-->\n<script type="text/javascript">\nREADTHEDOCS_DATA = JSON.parse(document.getElementById(\'READTHEDOCS_DATA\').innerHTML);\n</script>\n\n<script type="text/javascript" src="https://assets.readthedocs.org/static/javascript/readthedocs-analytics.js" async="async"></script>\n\n<!-- end RTD <extrahead> -->\n</head>\n\n<body class="wy-body-for-nav"> \n  <div class="wy-grid-for-nav">\n    <nav data-toggle="wy-nav-shift" class="wy-nav-side">\n      <div class="wy-side-scroll">\n        <div class="wy-side-nav-search" >\n\n          \n          \n          <a href="#" class="icon icon-home">\n            Python\n          </a>\n        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">\n              <ul>\n<li class="toctree-l1"><a class="reference internal" href="#document-foo">foo</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >\n          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>\n          <a href="#">Python</a>\n      </nav>\n\n      <div class="wy-nav-content">\n        <div class="rst-content">\n          <div role="navigation" aria-label="Page navigation">\n  <ul class="wy-breadcrumbs">\n      <li><a href="#" class="icon icon-home" aria-label="Home"></a></li>\n      <li class="breadcrumb-item active">Python  documentation</li>\n      <li class="wy-breadcrumbs-aside">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">\n           <div itemprop="articleBody">\n             \n  <section id="test-basic">\n<h1>test-basic<a class="headerlink" href="#test-basic" title="Link to this heading">\uf0c1</a></h1>\n<div class="toctree-wrapper compound">\n<span id="document-foo"></span><section id="foo">\n<h2>foo<a class="headerlink" href="#foo" title="Link to this heading">\uf0c1</a></h2>\n<div class="toctree-wrapper compound">\n<span id="document-bar"></span><section id="bar">\n<h3>bar<a class="headerlink" href="#bar" title="Link to this heading">\uf0c1</a></h3>\n</section>\n</div>\n</section>\n</div>\n<section id="heading">\n<h2>Heading<a class="headerlink" href="#heading" title="Link to this heading">\uf0c1</a></h2>\n<section id="subheading">\n<h3>Subheading<a class="headerlink" href="#subheading" title="Link to this heading">\uf0c1</a></h3>\n</section>\n</section>\n</section>\n\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role="contentinfo">\n    <p>&#169; Copyright .</p>\n  </div>\n\n  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a\n    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>\n    provided by <a href="https://readthedocs.org">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script> \n\n</body>\n</html>'

tests/test_builders.py:47: AssertionError

Expected Results

Test passes

Environment Info

  • Python Version: 3.11.9
  • Sphinx Version: 7.3.7
  • RTD Theme Version: 2.0.0
@heirecka heirecka added Bug A bug Needed: replication Bug replication is required labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

1 participant