SF.net SVN: docutils:[9637 ] trunk/docutils/test/test _writers/test_html5_polyglo t_parts.py

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9637
          http://sourceforge.net/p/docutils/code/9637
Author:   milde
Date:     2024-04-11 23:03:24 +0000 (Thu, 11 Apr 2024)
Log Message:
-----------
Fix test failure with pygments >= 2.14.

Pygments' output changed in version 2.14.
Ignore for now.

Fixes [bugs:#484].

Modified Paths:
--------------
    trunk/docutils/test/test_writers/test_html5_polyglot_parts.py

Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py	2024-04-10 22:22:32 UTC (rev 9636)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py	2024-04-11 23:03:24 UTC (rev 9637)
@@ -14,6 +14,7 @@
 
 from pathlib import Path
 import os
+import re
 import sys
 import unittest
 
@@ -25,6 +26,12 @@
 import docutils
 import docutils.core
 from docutils.utils.code_analyzer import with_pygments
+if with_pygments:
+    import pygments
+    _pv = re.match(r'^([0-9]+)\.([0-9]*)', pygments.__version__)
+    if (int(_pv[1]), int(_pv[2])) >= (2, 14):
+        # pygments output changed in version 2.14
+        with_pygments = False
 
 ROOT_PREFIX = (Path(__file__).parent.parent/'functional'/'input').as_posix()
 DATA_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', 'data'))

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.