| 
      
      
      From: Günter M. <mi...@us...> - 2024-04-15 12:29:44
      
     | 
| I changed the test a bit to cover the case of Docutils without PIL.
Could you test once more with [r9643]?
---
**[bugs:#485] 0.21.1: `FAIL: test_publish (test_writers.test_html5_polyglot_parts.Html5WriterPublishPartsTestCase.test_publish) (id="totest['image_messages'][0]")`**
**Status:** open
**Created:** Thu Apr 11, 2024 02:48 PM UTC by Michał Górny
**Last Updated:** Fri Apr 12, 2024 12:06 PM UTC
**Owner:** nobody
This is one more test failure, introduced by a different commit than these reported in #484:
```
======================================================================
FAIL: test_publish (test_writers.test_html5_polyglot_parts.Html5WriterPublishPartsTestCase.test_publish) (id="totest['image_messages'][0]")
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/docutils/test/test_writers/test_html5_polyglot_parts.py", line 54, in test_publish
    self.assertEqual(case_expected, self.format_output(parts))
AssertionError: {'fra[318 chars]y: \'dummy.png\'</p>\n</aside>\n<aside class="[620 chars]>\n'} != {'fra[318 chars]y: \'/tmp/docutils/test/dummy.png\'</p>\n</asi[639 chars]>\n'}
  {'fragment': '<img alt="dummy.png" src="dummy.png" />\n'
               '<aside class="system-message">\n'
               '<p class="system-message-title">System Message: WARNING/2 (<span '
               'class="docutils literal"><string></span>, line 1)</p>\n'
               '<p>Cannot scale image!\n'
               '  Could not get size from "dummy.png":\n'
-              "  [Errno 2] No such file or directory: 'dummy.png'</p>\n"
?              ^                                        -----------------
+              '  [Errno 2] No such file or directory: '
?              ^
+              "'/tmp/docutils/test/dummy.png'</p>\n"
               '</aside>\n'
               '<aside class="system-message">\n'
               '<p class="system-message-title">System Message: ERROR/3 (<span '
               'class="docutils literal"><string></span>, line 1)</p>\n'
               '<p>Cannot embed image "dummy.png":\n'
               "  [Errno 2] No such file or directory: 'dummy.png'</p>\n"
               '</aside>\n'
               '<video src="dummy.mp4" title="dummy.mp4">\n'
               '<a href="dummy.mp4">dummy.mp4</a>\n'
               '</video>\n'
               '<aside class="system-message">\n'
               '<p class="system-message-title">System Message: WARNING/2 (<span '
               'class="docutils literal"><string></span>, line 5)</p>\n'
               '<p>Cannot scale image!\n'
               '  Could not get size from "dummy.mp4":\n'
               '  PIL cannot read video images.</p>\n'
               '</aside>\n'}
```
Bisected it down to:
```
commit 2d4e66bb87aff0b62c67f3edc9792298dbadff07
Author: milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
Date:   Thu Dec 14 22:38:58 2023 +0000
    Refactor "_html_base" writer.
    
    Auxiliary method `HTMLTranslator.image_size()` to bring
    `HTMLTranslator.visit_image()` to a reasonable size.
    
    Improve/test error reporting when an image file cannot be read.
    
    Sort methods in `HTMLTranslator`.
    
    Small cleanups and optimizations.
    
    git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@9501 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
 docutils/writers/_html_base.py                 | 230 ++++++++++++-------------
 test/test_writers/test_html5_polyglot_misc.py  |   4 +-
 test/test_writers/test_html5_polyglot_parts.py |  72 +++++++-
 3 files changed, 181 insertions(+), 125 deletions(-)
```
I can reproduce with Python 3.10.14, 3.11.9, 3.12.3; Pillow 10.3.0, Pygments 2.17.2.
---
Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list. |