This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new 45902b7  Allow newer versions of Pygments to be used
45902b7 is described below

commit 45902b7758f19acb8ea6164d972cfe0b59ce8a6e
Author: Dave Brondsema <[email protected]>
AuthorDate: Wed Mar 24 13:43:24 2021 -0400

    Allow newer versions of Pygments to be used
---
 Allura/allura/tests/test_globals.py | 7 ++++++-
 Allura/allura/tests/test_utils.py   | 7 ++++++-
 requirements.in                     | 2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/tests/test_globals.py 
b/Allura/allura/tests/test_globals.py
index 43e3905..72e3745 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -833,7 +833,12 @@ class TestEmojis(unittest.TestCase):
         output = g.markdown.convert('```html\n<p>:camel:</p>\n```')
         assert_in(':camel:', output)
         output = g.markdown.convert('~~~\n:camel:\n~~~')
-        assert_in('<span></span><span class="err">:camel:</span>', output)
+        try:
+            # older pygments
+            assert_in('<span></span><span class="err">:camel:</span>', output)
+        except AssertionError:
+            # newer pygments
+            assert_in('<pre><span></span>:camel:\n</pre>', output)
 
     def test_markdown_commit_with_emojis(self):
         output = g.markdown_commit.convert('Thumbs up emoji :+1: wow!')
diff --git a/Allura/allura/tests/test_utils.py 
b/Allura/allura/tests/test_utils.py
index 98f5b12..c3b82c8 100644
--- a/Allura/allura/tests/test_utils.py
+++ b/Allura/allura/tests/test_utils.py
@@ -228,7 +228,12 @@ class TestLineAnchorCodeHtmlFormatter(unittest.TestCase):
         hl_code = highlight(code, lexer, formatter)
         assert '<div class="codehilite">' in hl_code
         assert '<div id="l1" class="code_block">' in hl_code
-        assert_in('<span class="lineno">1 </span>', hl_code)
+        try:
+            # older pygments
+            assert_in('<span class="lineno">1 </span>', hl_code)
+        except AssertionError:
+            # newer pygments
+            assert_in('<span class="linenos">1</span>', hl_code)
 
 
 class TestIsTextFile(unittest.TestCase):
diff --git a/requirements.in b/requirements.in
index a80f22f..dc4e223 100644
--- a/requirements.in
+++ b/requirements.in
@@ -31,7 +31,7 @@ PasteScript
 Pillow
 # profanity filter for feedback
 profanityfilter==2.0.6
-Pygments==2.5.2
+Pygments
 pymongo==3.10.1
 Pypeline[creole,markdown,textile,rst]
 pysolr==3.6.0

Reply via email to