aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2014-11-04 19:02:57 +0300
committerDmitry Shachnev <mitya57@gmail.com>2014-11-04 19:02:57 +0300
commitf0357b28ef1723929146eabe6571d7c436c90c34 (patch)
treec3069e3575a0b7043378ebbd7de8e6b3afdc6266
parent0f008f7c7dbd9b98c82d1c50337b8b8ffe486dec (diff)
downloadmarkdown-f0357b28ef1723929146eabe6571d7c436c90c34.tar.gz
markdown-f0357b28ef1723929146eabe6571d7c436c90c34.tar.bz2
markdown-f0357b28ef1723929146eabe6571d7c436c90c34.zip
Make TestCodeHilite tests working with Pygments 2.0rc1.
Fixes #361.
-rw-r--r--tests/test_extensions.py14
1 files changed, 5 insertions, 9 deletions
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),
- '<div class="codehilite">'
- '<pre><span class="c"># A Code Comment</span>\n'
- '</pre></div>')
+ # Pygments can use random lexer here as we did not specify the language
+ self.assertTrue(md.convert(text).startswith('<div class="codehilite"><pre>'))
else:
self.assertEqual(md.convert(text),
'<pre class="codehilite"><code># 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),
- '<div class="codehilite">'
- '<pre><span class="c"># A Code Comment</span>\n'
- '</pre></div>')
+ # Pygments can use random lexer here as we did not specify the language
+ self.assertTrue(md.convert(text).startswith('<div class="codehilite"><pre>'))
else:
self.assertEqual(md.convert(text),
'<pre class="codehilite"><code># A Code Comment'