[test] generated html differs w/ pygments version stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 02 Jun 2010 15:27:34 +0200
branchstable
changeset 5631 e2e99cdf0899
parent 5630 40d7c7e180f1
child 5632 1e7c662bd6f8
[test] generated html differs w/ pygments version
test/unittest_entity.py
--- a/test/unittest_entity.py	Wed Jun 02 14:48:36 2010 +0200
+++ b/test/unittest_entity.py	Wed Jun 02 15:27:34 2010 +0200
@@ -356,8 +356,15 @@
                             data_encoding=u'ascii', data_name=u'toto.py')
         from cubicweb import mttransforms
         if mttransforms.HAS_PYGMENTS_TRANSFORMS:
-            self.assertEquals(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>
+            import pygments
+            if tuple(int(i) for i in pygments.__version__.split('.')[:2]) >= (1, 3):
+                self.assertEquals(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>
+''')
+            else
+                self.assertEquals(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>
 ''')
         else: