Skip to content

Commit

Permalink
Make TestCodeHilite tests working with Pygments 2.0rc1.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed Nov 4, 2014
1 parent 0f008f7 commit f0357b2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ def testBasicCodeHilite(self):
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'
Expand All @@ -105,7 +103,7 @@ def testLinenumsTrue(self):
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(
Expand Down Expand Up @@ -134,10 +132,8 @@ def testLinenumsNone(self):
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'
Expand Down

0 comments on commit f0357b2

Please sign in to comment.