From 81b724cfec03634c0bcd88b1bccb5936872d04e2 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 28 Jan 2016 22:09:56 -0500 Subject: Enabled pygments based tests. Added pygments to test-requirements and updated codehiliting tests to only test partial output as output differs depending on Pygments version. Fixes #453 --- test-requirements.txt | 3 ++- tests/test_extensions.py | 47 ++++++++++++----------------------------------- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 7c93558..b7bcf16 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,5 @@ nose coverage<4.0 pyyaml -pytidylib \ No newline at end of file +pytidylib +pygments diff --git a/tests/test_extensions.py b/tests/test_extensions.py index 38f0be3..72ce212 100644 --- a/tests/test_extensions.py +++ b/tests/test_extensions.py @@ -134,12 +134,7 @@ class TestCodeHilite(unittest.TestCase): md = markdown.Markdown( extensions=[markdown.extensions.codehilite.CodeHiliteExtension(linenums=False)]) if self.has_pygments: - self.assertEqual( - md.convert(text), - '
' - '
# A Code Comment\n'
-                '
' - ) + self.assertTrue(md.convert(text).startswith('
'
-                '
# A Code Comment\n'
-                '
' - ) + self.assertTrue(md.convert(text).startswith('
'
-                    '#line 1\n'
-                    '#line 2\n'
-                    '#line 3\n'
-                    '
' + self.assertTrue( + md.convert(text).startswith( + '
'
-                'line 1\n'
-                'line 2\n'
-                'line 3\n'
-                '
' + self.assertTrue( + md.convert(text).startswith('
'
-                    '#line 1\n'
-                    '#line 2\n'
-                    '#line 3\n'
-                    '
' + self.assertTrue( + md.convert(text).startswith('