cubicweb/test/unittest_entity.py
changeset 11196 74b04a88d28a
parent 11057 0b59724cb3f2
child 11271 fd177546bbea
--- a/cubicweb/test/unittest_entity.py	Thu Jun 12 15:54:44 2014 +0200
+++ b/cubicweb/test/unittest_entity.py	Wed Mar 16 00:42:40 2016 +0100
@@ -640,14 +640,18 @@
             from cubicweb import mttransforms
             if mttransforms.HAS_PYGMENTS_TRANSFORMS:
                 import pygments
+                if tuple(int(i) for i in pygments.__version__.split('.')[:3]) >= (2, 1, 1):
+                    span = '<span/>'
+                else:
+                    span = ''
                 if tuple(int(i) for i in pygments.__version__.split('.')[:2]) >= (1, 3):
-                    self.assertEqual(e.printable_value('data'),
-                                      '''<div class="highlight"><pre><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="mi">1</span>
-</pre></div>''')
+                    mi = 'mi'
                 else:
-                    self.assertEqual(e.printable_value('data'),
-                                      '''<div class="highlight"><pre><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="mf">1</span>
-</pre></div>''')
+                    mi = 'mf'
+
+                self.assertEqual(e.printable_value('data'),
+                                 '''<div class="highlight"><pre>%s<span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="%s">1</span>
+</pre></div>''' % (span, mi))
             else:
                 self.assertEqual(e.printable_value('data'),
                                   '''<pre class="python">