summaryrefslogtreecommitdiff
path: root/dev-python/docutils/files/docutils-0.21.1-test.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/docutils/files/docutils-0.21.1-test.patch')
-rw-r--r--dev-python/docutils/files/docutils-0.21.1-test.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/dev-python/docutils/files/docutils-0.21.1-test.patch b/dev-python/docutils/files/docutils-0.21.1-test.patch
new file mode 100644
index 000000000000..507fd239c166
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.21.1-test.patch
@@ -0,0 +1,42 @@
+diff --git a/test/test_writers/test_html5_polyglot_parts.py b/test/test_writers/test_html5_polyglot_parts.py
+index fb2792ee7..cb03fea2f 100644
+--- a/test/test_writers/test_html5_polyglot_parts.py
++++ b/test/test_writers/test_html5_polyglot_parts.py
+@@ -24,11 +24,20 @@ if __name__ == '__main__':
+
+ import docutils
+ import docutils.core
++from docutils.parsers.rst.directives.images import PIL
+ from docutils.utils.code_analyzer import with_pygments
+
+ ROOT_PREFIX = (Path(__file__).parent.parent/'functional'/'input').as_posix()
+ DATA_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', 'data'))
+
++with_pygments = False
++PIL_NOT_FOUND_PATH = 'dummy.png'
++try:
++ if PIL and (tuple(int(i) for i in PIL.__version__.split('.')) >= (10, 3)):
++ PIL_NOT_FOUND_PATH = Path('dummy.png').resolve()
++except:
++ PIL = None
++
+
+ class Html5WriterPublishPartsTestCase(unittest.TestCase):
+ """Test case for HTML writer via the publish_parts interface."""
+@@ -642,14 +651,14 @@ totest['system_messages'] = ({'stylesheet_path': '',
+ .. image:: dummy.mp4
+ :scale: 100%
+ """,
+-{'fragment': """\
++{'fragment': f"""\
+ <img alt="dummy.png" src="dummy.png" />
+ <aside class="system-message">
+ <p class="system-message-title">System Message: WARNING/2 \
+ (<span class="docutils literal">&lt;string&gt;</span>, line 1)</p>
+ <p>Cannot scale image!
+ Could not get size from &quot;dummy.png&quot;:
+- [Errno 2] No such file or directory: 'dummy.png'</p>
++ [Errno 2] No such file or directory: '{PIL_NOT_FOUND_PATH}'</p>
+ </aside>
+ <aside class="system-message">
+ <p class="system-message-title">System Message: ERROR/3 \