Repository navigation
Closed
Description
Checklist
- Raised initially as discussion #... (given that the test suite fail, I hope that the discussion is not necessary)
- This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
- I have reduced the issue to the simplest possible case. (again, I don't think it applies for the failing test)
When packaging this project as a package for openSUSE/Factory, this test fails:
[ 15s] =================================== FAILURES ===================================
[ 15s] __________________ TestViewNamesAndDescriptions.test_markdown __________________
[ 15s] tests/test_description.py:170: in test_markdown
[ 15s] assert apply_markdown(DESCRIPTION) == MARKDOWN_BASE % MARKDOWN_gte_33
[ 15s] E AssertionError: assert ('<h2 id="an-example-docstring">an example docstring</h2>\n'\n '<ul>\n'\n '<li>list</li>\n'\n '<li>list</li>\n'\n '</ul>\n'\n '<h3 id="another-header">another header</h3>\n'\n '<pre><code>code block\n'\n '</code></pre>\n'\n '<p>indented</p>\n'\n '<h2 id="hash-style-header">hash style header</h2>\n'\n '<p><code>json\n'\n '[{\n'\n ' "alpha": 1,\n'\n ' "beta: "this is a string"\n'\n '}]</code></p>') == ('<h2 id="an-example-docstring">an example docstring</h2>\n'\n '<ul>\n'\n '<li>list</li>\n'\n '<li>list</li>\n'\n '</ul>\n'\n '<h3 id="another-header">another header</h3>\n'\n '<pre><code>code block\n'\n '</code></pre>\n'\n '<p>indented</p>\n'\n '<h2 id="hash-style-header">hash style header</h2>\n'\n '<div class="highlight"><pre><span></span><span class="p">[{</span><br /> '\n '<span class="nt">"alpha"</span><span class="p">:</span> <span '\n 'class="mi">1</span><span class="p">,</span><br /> <span '\n 'class="nt">"beta: "</span><span class="err">this</span> <span '\n 'class="err">is</span> <span class="err">a</span> <span '\n 'class="err">string"</span><br /><span class="p">}]</span><br '\n '/></pre></div>\n'\n '<p><br /></p>')
[ 15s] E <h2 id="an-example-docstring">an example docstring</h2>
[ 15s] E <ul>
[ 15s] E <li>list</li>
[ 15s] E <li>list</li>
[ 15s] E </ul>
[ 15s] E <h3 id="another-header">another header</h3>
[ 15s] E <pre><code>code block
[ 15s] E </code></pre>
[ 15s] E <p>indented</p>
[ 15s] E <h2 id="hash-style-header">hash style header</h2>
[ 15s] E - <div class="highlight"><pre><span></span><span class="p">[{</span><br /> <span class="nt">"alpha"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span><br /> <span class="nt">"beta: "</span><span class="err">this</span> <span class="err">is</span> <span class="err">a</span> <span class="err">string"</span><br /><span class="p">}]</span><br /></pre></div>
[ 15s] E - <p><br /></p>
[ 15s] E + <p><code>json
[ 15s] E + [{
[ 15s] E + "alpha": 1,
[ 15s] E + "beta: "this is a string"
[ 15s] E + }]</code></p>
Using Python 3.6.14, djangorestframework-3.12.4, complete build log with all packages used and steps taken.
Metadata
Metadata
Assignees
Labels
No labels
Activity
sandrotosi commentedon Dec 13, 2021
Can anyone look into this issue? it is now affecting debian: https://ci.debian.net/data/autopkgtest/testing/amd64/d/djangorestframework/17493317/log.gz
thanks!
lovelydinosaur commentedon Dec 13, 2021
My assumption would be that this is the result of some minor patch version of the markdown library handling the markdown rendering slightly differently. Not super easy to see why since our test cases aren't actually failing.
PR #8293 cleans up a bit of the markdown that was rendering into the text you're seeing, and that I suspect was causing the issue, so I'll close this off on the assumption that it's most likely where the issue was caused.
As an aside, I don't really understand linux distributions that bundle Django or Django REST framework. They're not really intended to be used as system-wide-installations.
(And no, I don't want particularly want to have a discussion about that.)
mcepl commentedon Dec 13, 2021
Yeah, the patch from #8293 doesn’t help at all:
sandrotosi commentedon Dec 13, 2021
this started happening in Debian after we upgraded pygments from 2.7.1 to 2.10.0. The reason your tests dont fail is likely because of this pygments requirement
@tomchristie please reopen as the issue is still present
thanks!
slyon commentedon Dec 17, 2021
I can confirm this. We're seeing the same issue in Ubuntu, the proposed fix does not actually solve the problem. Please re-open and try to verify you test suite with pygments 2.10, as suggested. (The markdown library did not change)
sandrotosi commentedon Dec 31, 2021
The failure we're seeing in Debian is slightly different, so i'm going to report it here if that helps (please note we're still on 3.12.4):
I'm going to skip this failing test for now, until this issue is addressed here
stanislavlevin commentedon Feb 28, 2022
Exactly this issue is due to the changes in Pygments 2.11.0:
Bisect points to pygments/pygments@b4f0583
See pygments/pygments#1905 for details.
It seems this test is very flaky in the current implementation.
stale commentedon Apr 29, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
mcepl commentedon Jun 20, 2022
Still as fresh as ever with 3.13.1 and Markdown 3.3.7:
Update python-djangorestframework to version 3.13.1 / rev 15 via SR 9…