test_markdown fails rendering with pygments > 2.10

Bug #1955134 reported by Lukas Märdian
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
djangorestframework (Ubuntu)
Fix Released
Undecided
Unassigned
pygments (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Upstream is aware of the problem (tho, the proposed fix does not resolve the issue quite yet):
https://github.com/encode/django-rest-framework/issues/8160

=================================== FAILURES ===================================
__________________ TestViewNamesAndDescriptions.test_markdown __________________

self = <tests.test_description.TestViewNamesAndDescriptions testMethod=test_markdown>

    @pytest.mark.skipif(not apply_markdown, reason="Markdown is not installed")
    def test_markdown(self):
        """
        Ensure markdown to HTML works as expected.
        """
        # Markdown 3.3 is only supported on Python 3.6 and higher
        if sys.version_info >= (3, 6):
> assert apply_markdown(DESCRIPTION) == MARKDOWN_BASE % MARKDOWN_gte_33
E AssertionError: assert '<h2 id="an-e...<p><br /></p>' == '<h2 id="an-e...<p><br /></p>'
E Skipping 445 identical leading characters in diff, use -v to show
E - an class="nt">&quot;beta: &quot;</span><span class="err">this</span> <span class="err">is</span> <span class="err">a</span> <span class="err">string&quot;</span><br /><span class="p">}]</span><br /></pre></div>
E + an class="s2">&quot;beta: &quot;</span><span class="kc">t</span><span class="err">his</span> <span class="err">is</span> <span class="err">a</span> <span class="err">s</span><span class="kc">tr</span><span class="err">i</span><span class="kc">n</span><span class="err">g&quot;</span><br /><span cl...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show

tests/test_description.py:170: AssertionError
=============================== warnings summary ===============================
tests/test_authtoken.py::AuthTokenTests::test_authtoken_can_be_imported_when_not_included_in_installed_apps
  /usr/lib/python3/dist-packages/django/db/models/base.py:316: RuntimeWarning: Model 'authtoken.token' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.
    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

tests/test_authtoken.py::AuthTokenTests::test_authtoken_can_be_imported_when_not_included_in_installed_apps
  /usr/lib/python3/dist-packages/django/db/models/base.py:316: RuntimeWarning: Model 'authtoken.tokenproxy' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.
    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_description.py::TestViewNamesAndDescriptions::test_markdown
=========== 1 failed, 1275 passed, 127 skipped, 2 warnings in 15.83s ===========

Lukas Märdian (slyon)
Changed in pygments (Ubuntu):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package djangorestframework - 3.12.4-2ubuntu1

---------------
djangorestframework (3.12.4-2ubuntu1) jammy; urgency=medium

  * d/tests/control
    - skip test_markdown, which is currently failing; see issue #8160 upstream
      for followups (LP: #1955134)

 -- Lukas Märdian <email address hidden> Wed, 05 Jan 2022 17:50:04 +0100

Changed in djangorestframework (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.