From e7259d5024c932707371f4e6ea8cbb3a8fe2d214 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Mon, 25 Feb 2013 10:39:19 -0500 Subject: CodeHilite tests pass in all pygments versions. --- tests/test_extensions.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/tests/test_extensions.py b/tests/test_extensions.py index d9d77b8..cb27a30 100644 --- a/tests/test_extensions.py +++ b/tests/test_extensions.py @@ -54,13 +54,11 @@ class TestCodeHilite(unittest.TestCase): text = '\t# A Code Comment' md = markdown.Markdown(extensions=['codehilite(linenums=True)']) if self.has_pygments: - self.assertEqual(md.convert(text), - '' - '' - '' - '
1
' - '
# A Code Comment\n
' - '
\n
') + # Differant 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( + '
')) else: self.assertEqual(md.convert(text), '
# A Code Comment'
@@ -96,13 +94,11 @@ class TestCodeHilite(unittest.TestCase):
         text = '\t#!Python\n\t# A Code Comment'
         md = markdown.Markdown(extensions=['codehilite(linenums=None)'])
         if self.has_pygments:
-            self.assertEqual(md.convert(text),
-                ''
-                ''
-                ''
-                '
1
' - '
# A Code Comment\n
' - '
\n
') + # Differant 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( + '
')) else: self.assertEqual(md.convert(text), '
# A Code Comment'
@@ -416,4 +412,4 @@ class TestTOC(unittest.TestCase):
                   '\n'
                 '\n'
               '\n'
-            '\n')
\ No newline at end of file
+            '\n')
-- 
cgit v1.2.3