MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

Test failures with sphinx 8.2.3

Open mweinelt opened this issue 1 year ago • 1 comments

What version of myst-parser are you using?

4.0.1

What version dependencies are you using?

sphinx 8.2.3 docutils 0.21.2

What operating system are you using?

Linux

Describe the Bug

Test failures due to fixtures not being compatible with sphinx 8.2.3.

FAILED tests/test_renderers/test_fixtures_sphinx.py::test_sphinx_directives[320-math (`sphinx.directives.patches.MathDirective`):] - AssertionError: actual != expected (use --regen-file-failure)
FAILED tests/test_sphinx/test_sphinx_builds.py::test_references_singlehtml - AssertionError: FILES DIFFER:
FAILED tests/test_sphinx/test_sphinx_builds.py::test_extended_syntaxes - AssertionError: FILES DIFFER:
FAILED tests/test_sphinx/test_sphinx_builds.py::test_fieldlist_extension - AssertionError: FILES DIFFER:

Expected Behavior

Compatibility with recent Sphinx versions

To Reproduce

Update to sphinx 8.2.3 and run the test suite.

mweinelt avatar Mar 03 '25 10:03 mweinelt

Or with Sphinx 9.0.3:

=========================== short test summary info ============================
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[166-Image empty:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_syntax_elements.md:166
+++ (actual)
@@ -1,3 +1,3 @@
 <document source="<src>/index.md">

     <paragraph>

-        <image alt="" uri="">
+        <image alt="" candidates="{'*': '.'}" original_uri="" uri=".">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[175-Image with alt and title:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_syntax_elements.md:175
+++ (actual)
@@ -1,3 +1,3 @@
 <document source="<src>/index.md">

     <paragraph>

-        <image alt="alt" title="title" uri="src">
+        <image alt="alt" candidates="{'*': 'src'}" title="title" uri="src">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[184-Image with escapable html:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_syntax_elements.md:184
+++ (actual)
@@ -1,3 +1,3 @@
 <document source="<src>/index.md">

     <paragraph>

-        <image alt="alt" uri="http://www.google%3C%3E.com">
+        <image alt="alt" candidates="{'?': 'http://www.google%3C%3E.com'}" uri="http://www.google%3C%3E.com">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[501-Front Matter:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_syntax_elements.md:501
+++ (actual)
@@ -1,23 +1 @@
-<document source="<src>/index.md">

-    <field_list>

-        <field>

-            <field_name>

-                a

-            <field_body>

-                <paragraph>

-                    <literal>

-                        1

-        <field>

-            <field_name>

-                b

-            <field_body>

-                <paragraph>

-                    <literal>

-                        foo

-        <field>

-            <field_name>

-                c

-            <field_body>

-                <paragraph>

-                    <literal>

-                        {"d": 2}
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[535-Front Matter Biblio:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_syntax_elements.md:535
+++ (actual)
@@ -1,93 +1,17 @@
 <document source="<src>/index.md">

-    <field_list>

-        <field>

-            <field_name>

-                author

-            <field_body>

-                <paragraph>

-                    Chris Sewell

-        <field>

-            <field_name>

-                authors

-            <field_body>

-                <paragraph>

-                    Chris Sewell, Chris Hodgraf

-        <field>

-            <field_name>

-                organization

-            <field_body>

-                <paragraph>

-                    EPFL

-        <field>

-            <field_name>

-                address

-            <field_body>

-                <paragraph>

-                    1 Cedar Park Close

+    <topic classes="dedication">

+        <title>

+            Dedication

+        <paragraph>

+            To my

+            <emphasis>

+                homies

 

-                    Thundersley

-

-                    Essex

-

-        <field>

-            <field_name>

-                contact

-            <field_body>

-                <paragraph>

-                    <reference refuri="https://example.com">

-                        https://example.com

-        <field>

-            <field_name>

-                version

-            <field_body>

-                <paragraph>

-                    1.0

-        <field>

-            <field_name>

-                revision

-            <field_body>

-                <paragraph>

-                    1.1

-        <field>

-            <field_name>

-                status

-            <field_body>

-                <paragraph>

-                    good

-        <field>

-            <field_name>

-                date

-            <field_body>

-                <paragraph>

-                    2/12/1985

-        <field>

-            <field_name>

-                copyright

-            <field_body>

-                <paragraph>

-                    MIT

-        <field>

-            <field_name>

-                dedication

-            <field_body>

-                <paragraph>

-                    To my

-                    <emphasis>

-                        homies

-

-        <field>

-            <field_name>

-                abstract

-            <field_body>

-                <paragraph>

-                    Something something

-                    <strong>

-                        dark

-                     side

-        <field>

-            <field_name>

-                other

-            <field_body>

-                <paragraph>

-                    <literal>

-                        Something else
+    <topic classes="abstract">

+        <title>

+            Abstract

+        <paragraph>

+            Something something

+            <strong>

+                dark

+             side
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[653-Front Matter Bad Yaml:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_syntax_elements.md:653
+++ (actual)
@@ -1,4 +1 @@
-<document source="<src>/index.md">

-    <system_message level="2" line="1" source="<src>/index.md" type="WARNING">

-        <paragraph>

-            Malformed YAML [myst.topmatter]
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[665-Front Matter HTML Meta] - KeyError: 'writer'
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_syntax_elements[711-Full Test:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_syntax_elements.md:711
+++ (actual)
@@ -1,14 +1,6 @@
 <document source="<src>/index.md">

-    <field_list>

-        <field>

-            <field_name>

-                a

-            <field_body>

-                <paragraph>

-                    <literal>

-                        1

-    <target ids="target" names="target">

-    <section ids="header-1" names="header\ 1">

+    <target refid="target">

+    <section ids="header-1 target" names="header\ 1 target">

         <title>

             header 1

         <section ids="sub-header-1" names="sub\ header\ 1">

@@ -32,7 +24,7 @@
                 <reference refuri="http://www.xyz.com">

                     a

                  z

-            <transition>

+    <transition>

     <section ids="header-2" names="header\ 2">

         <title>

             header 2
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[1-Test Directive 1:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:1
+++ (actual)
@@ -1,4 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=[], options={}, content: None
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[12-Test Directive 2:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:12
+++ (actual)
@@ -1,6 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=[], options={}, content:

-        <literal_block xml:space="preserve">

-            foo
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[26-Test Directive 3:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:26
+++ (actual)
@@ -1,4 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=['foo'], options={}, content: None
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[37-Test Directive 4:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:37
+++ (actual)
@@ -1,6 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=['foo'], options={}, content:

-        <literal_block xml:space="preserve">

-            bar
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[51-Test Directive 5:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:51
+++ (actual)
@@ -1,4 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=['foo bar'], options={}, content: None
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[62-Test Directive 6:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:62
+++ (actual)
@@ -1,6 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=['foo bar'], options={}, content:

-        <literal_block xml:space="preserve">

-            baz
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[76-Test Directive 7:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:76
+++ (actual)
@@ -1,6 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=[], options={}, content:

-        <literal_block xml:space="preserve">

-            foo
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[91-Test Directive Options 1:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:91
+++ (actual)
@@ -1,6 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=[], options={'option1': 'a', 'option2': 'b'}, content:

-        <literal_block xml:space="preserve">

-            foo
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[109-Test Directive Options 2:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:109
+++ (actual)
@@ -1,6 +1 @@
-<document source="<src>/index.md">

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=[], options={'option1': 'a', 'option2': 'b'}, content:

-        <literal_block xml:space="preserve">

-            foo
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[125-Test Directive Options Error:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:125
+++ (actual)
@@ -1,9 +1 @@
-<document source="<src>/index.md">

-    <system_message level="2" line="1" source="<src>/index.md" type="WARNING">

-        <paragraph>

-            'restructuredtext-test-directive': Invalid options format: expected ':' after key [myst.directive_option]

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            Directive processed. Type="restructuredtext-test-directive", arguments=[], options={}, content:

-        <literal_block xml:space="preserve">

-            foo
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_directive_options[144-Unknown Directive:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/directive_options.md:144
+++ (actual)
@@ -1,8 +1 @@
-<document source="<src>/index.md">

-    <system_message level="2" line="1" source="<src>/index.md" type="WARNING">

-        <paragraph>

-            Unknown directive type: 'unknown' [myst.directive_unknown]

-    <system_message level="1" line="1" source="<src>/index.md" type="INFO">

-        <paragraph>

-            No directive entry for "unknown" in module "docutils.parsers.rst.languages.en".

-            Trying "unknown" as canonical directive name.
+<document source="<src>/index.md">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_sphinx_directives[73-toctree (`sphinx.directives.other.TocTree`):] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_directives.md:73
+++ (actual)
@@ -1,3 +1,3 @@
 <document source="<src>/index.md">

     <compound classes="toctree-wrapper">

-        <toctree caption="True" entries="" glob="False" hidden="False" includefiles="" includehidden="False" maxdepth="-1" numbered="0" parent="index" titlesonly="False">
+        <toctree caption="True" entries="" glob="False" hidden="False" includefiles="" includehidden="False" maxdepth="-1" numbered="0" parent="index" rawentries="" titlesonly="False">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_sphinx_directives[199-figure (`sphinx.directives.patches.Figure`):] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_directives.md:199
+++ (actual)
@@ -1,6 +1,6 @@
 <document source="<src>/index.md">

-    <figure>

-        <image uri="path/to/figure">

+    <figure ids="id1">

+        <image candidates="{'*': 'path/to/figure'}" uri="path/to/figure">

         <caption>

             <emphasis>

                 caption
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_sphinx_directives[320-math (`sphinx.directives.patches.MathDirective`):] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_directives.md:320
+++ (actual)
@@ -1,2 +1,2 @@
 <document source="<src>/index.md">

-    <math_block docname="index" label="True" nowrap="False" number="True" xml:space="preserve">
+    <math_block docname="index" label="True" no-wrap="False" nowrap="False" number="True" xml:space="preserve">
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_sphinx_roles[223-js:class (`sphinx.domains.javascript.JSConstructor`):] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/sphinx_roles.md:223
+++ (actual)
@@ -2,4 +2,4 @@
     <paragraph>

         <pending_xref js:module="True" js:object="True" refdoc="index" refdomain="js" refexplicit="False" reftarget="a" reftype="class" refwarn="False">

             <literal classes="xref js js-class">

-                a()
+                a
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_dollarmath[47-Math Block With Equation Label:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/dollarmath.md:47
+++ (actual)
@@ -1,4 +1,4 @@
 <document source="<src>/index.md">

-    <target ids="equation-abc">

-    <math_block docname="index" label="abc" nowrap="False" number="1" xml:space="preserve">

+    <target refid="equation-abc">

+    <math_block docname="index" ids="equation-abc" label="abc" nowrap="False" number="1" xml:space="preserve">

         foo
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_dollarmath[57-Math Block multiple:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/dollarmath.md:57
+++ (actual)
@@ -2,7 +2,7 @@
     <math_block nowrap="False" number="True" xml:space="preserve">

 

         a = 1

-    <target ids="equation-a">

-    <math_block docname="index" label="a" nowrap="False" number="1" xml:space="preserve">

+    <target refid="equation-a">

+    <math_block docname="index" ids="equation-a" label="a" nowrap="False" number="1" xml:space="preserve">

 

         b = 2
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_amsmath[1-Single Line:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/amsmath.md:1
+++ (actual)
@@ -1,4 +1,4 @@
 <document source="<src>/index.md">

-    <target ids="equation-mock-uuid">

-    <math_block classes="amsmath" docname="index" label="mock-uuid" nowrap="True" number="1" xml:space="preserve">

+    <target refid="equation-mock-uuid">

+    <math_block classes="amsmath" docname="index" ids="equation-mock-uuid" label="mock-uuid" nowrap="True" number="1" xml:space="preserve">

         \begin{equation} a \end{equation}
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_amsmath[11-Multi Line:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/amsmath.md:11
+++ (actual)
@@ -1,6 +1,6 @@
 <document source="<src>/index.md">

-    <target ids="equation-mock-uuid">

-    <math_block classes="amsmath" docname="index" label="mock-uuid" nowrap="True" number="1" xml:space="preserve">

+    <target refid="equation-mock-uuid">

+    <math_block classes="amsmath" docname="index" ids="equation-mock-uuid" label="mock-uuid" nowrap="True" number="1" xml:space="preserve">

         \begin{equation}

         a

         \end{equation}
FAILED tests/test_renderers/test_fixtures_sphinx.py::test_amsmath[38-In list:] - AssertionError: Actual does not match expected
--- /tmp/guix-build-python-myst-parser-4.0.1.drv-0/source/tests/test_renderers/fixtures/amsmath.md:38
+++ (actual)
@@ -1,8 +1,8 @@
 <document source="<src>/index.md">

     <bullet_list bullet="-">

         <list_item>

-            <target ids="equation-mock-uuid">

-            <math_block classes="amsmath" docname="index" label="mock-uuid" nowrap="True" number="1" xml:space="preserve">

+            <target refid="equation-mock-uuid">

+            <math_block classes="amsmath" docname="index" ids="equation-mock-uuid" label="mock-uuid" nowrap="True" number="1" xml:space="preserve">

                 \begin{equation}

                 a = 1

                 \end{equation}
FAILED tests/test_sphinx/test_sphinx_builds.py::test_references_singlehtml - AssertionError: FILES DIFFER:
/tmp/guix-build-python-myst-parser-4.0.1.drv-0/pytest-of-nixbld/pytest-0/test_references_singlehtml0/test_sphinx_builds/test_references_singlehtml.html
/tmp/guix-build-python-myst-parser-4.0.1.drv-0/pytest-of-nixbld/pytest-0/test_references_singlehtml0/test_sphinx_builds/test_references_singlehtml.obtained.html
HTML DIFF: /tmp/guix-build-python-myst-parser-4.0.1.drv-0/pytest-of-nixbld/pytest-0/test_references_singlehtml0/test_sphinx_builds/test_references_singlehtml.obtained.diff.html
--- 
+++ 
@@ -50,7 +50,7 @@
          </a>
         </p>
         <p>
-         <a class="reference internal" href="#title">
+         <a class="reference internal" href="#document-index#title">
           <span class="std std-ref">
            Title
           </span>
@@ -99,7 +99,7 @@
      </a>
     </p>
     <p>
-     <a class="reference internal" href="#other-title">
+     <a class="reference internal" href="#document-other/other#other-title">
       <span class="std std-ref">
        Other Title
       </span>
FAILED tests/test_sphinx/test_sphinx_builds.py::test_extended_syntaxes - KeyError: 'writer'
FAILED tests/test_sphinx/test_sphinx_builds.py::test_fieldlist_extension - AssertionError: FILES DIFFER:
/tmp/guix-build-python-myst-parser-4.0.1.drv-0/pytest-of-nixbld/pytest-0/test_fieldlist_extension0/test_sphinx_builds/test_fieldlist_extension.xml
/tmp/guix-build-python-myst-parser-4.0.1.drv-0/pytest-of-nixbld/pytest-0/test_fieldlist_extension0/test_sphinx_builds/test_fieldlist_extension.obtained.xml
HTML DIFF: /tmp/guix-build-python-myst-parser-4.0.1.drv-0/pytest-of-nixbld/pytest-0/test_fieldlist_extension0/test_sphinx_builds/test_fieldlist_extension.obtained.diff.html
--- 
+++ 
@@ -19,7 +19,7 @@
             <desc_signature _toc_name="send_message()" _toc_parts="('send_message',)" class="" classes="sig sig-object" fullname="send_message" ids="send_message" module="True">
                 <desc_name classes="sig-name descname" xml:space="preserve">
                     send_message
-                <desc_parameterlist xml:space="preserve">
+                <desc_parameterlist multi_line_trailing_comma="True" xml:space="preserve">
                     <desc_parameter xml:space="preserve">
                         <desc_sig_name classes="n">
                             sender
=== 31 failed, 1019 passed, 11 skipped, 1 deselected, 408 warnings in 3.57s ====

apteryks avatar Dec 04 '25 05:12 apteryks