[test] fix test_printable_value_bytes with current pygments
An empty span was added in
https://bitbucket.org/birkenfeld/pygments-main/commits/164574c13533195a555181a2b9c685fea2470403
--- 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">