SF.net SVN: docutils:[9924 ] trunk/docutils/test/test _writers/test_html4css1.py

grubert--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9924
          http://sourceforge.net/p/docutils/code/9924
Author:   grubert
Date:     2024-09-10 18:17:15 +0000 (Tue, 10 Sep 2024)
Log Message:
-----------
FIX test_writers html4css when PIL is not installed

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

Modified: trunk/docutils/test/test_writers/test_html4css1.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1.py	2024-09-10 15:30:31 UTC (rev 9923)
+++ trunk/docutils/test/test_writers/test_html4css1.py	2024-09-10 18:17:15 UTC (rev 9924)
@@ -21,6 +21,7 @@
 
 import docutils
 import docutils.core
+from docutils.parsers.rst.directives.images import PIL
 from docutils.utils.code_analyzer import with_pygments
 from docutils.writers import html4css1
 
@@ -36,6 +37,11 @@
 DATA_ROOT = TEST_ROOT / 'data'
 ROOT_PREFIX = (TEST_ROOT / 'functional/input').as_posix()
 
+# Pillow/PIL is optional:
+if PIL:
+    SCALING_OUTPUT = 'style="width: 32px; height: 32px;" '
+else:
+    SCALING_OUTPUT = ''
 
 class Html5WriterPublishPartsTestCase(unittest.TestCase):
     """Test case for HTML5 writer via the publish_parts() interface."""
@@ -416,8 +422,8 @@
    :scale: 100%
 .. figure:: /data/blue%20square.png
 """,
-"""\
-<img alt="/data/blue%20square.png" src="/data/blue%20square.png" style="width: 32.0px; height: 32.0px;" />
+f"""\
+<img alt="/data/blue%20square.png" src="/data/blue%20square.png" {SCALING_OUTPUT}/>
 <div class="figure">
 <img alt="/data/blue%20square.png" src="/data/blue%20square.png" />
 </div>

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.