From f0357b28ef1723929146eabe6571d7c436c90c34 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Tue, 4 Nov 2014 19:02:57 +0300 Subject: Make TestCodeHilite tests working with Pygments 2.0rc1. Fixes #361. --- tests/test_extensions.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/test_extensions.py b/tests/test_extensions.py index a21fd94..efd9524 100644 --- a/tests/test_extensions.py +++ b/tests/test_extensions.py @@ -91,10 +91,8 @@ class TestCodeHilite(unittest.TestCase): text = '\t# A Code Comment' md = markdown.Markdown(extensions=['markdown.extensions.codehilite']) if self.has_pygments: - self.assertEqual(md.convert(text), - '
' - '
# A Code Comment\n'
-                '
') + # Pygments can use random lexer here as we did not specify the language + self.assertTrue(md.convert(text).startswith('
'))
         else:
             self.assertEqual(md.convert(text),
                 '
# A Code Comment'
@@ -105,7 +103,7 @@ class TestCodeHilite(unittest.TestCase):
         md = markdown.Markdown(
             extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=True)])
         if self.has_pygments:
-            # Differant versions of pygments output slightly different markup.
+            # Different versions of pygments output slightly different markup.
             # So we use 'startwith' and test just enough to confirm that 
             # pygments received and processed linenums.
             self.assertTrue(md.convert(text).startswith(
@@ -134,10 +132,8 @@ class TestCodeHilite(unittest.TestCase):
         md = markdown.Markdown(
             extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=None)])
         if self.has_pygments:
-            self.assertEqual(md.convert(text),
-                '
' - '
# A Code Comment\n'
-                '
') + # Pygments can use random lexer here as we did not specify the language + self.assertTrue(md.convert(text).startswith('
'))
         else:
             self.assertEqual(md.convert(text),
                 '
# A Code Comment'
-- 
cgit v1.2.3