mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-04 07:57:52 +03:00
Make tests fail when an error is reported by GhostScript
This commit is contained in:
parent
85cfc933c6
commit
8defa11c47
@ -29,6 +29,10 @@ def document_write_png(self, target=None, resolution=96, antialiasing=1):
|
||||
f'-r{resolution}', '-sOutputFile=-', '-']
|
||||
pngs = run(command, input=pdf, stdout=PIPE).stdout
|
||||
|
||||
assert pngs.startswith(MAGIC_NUMBER), (
|
||||
'GhostScript error: '
|
||||
f'{pngs.split(MAGIC_NUMBER)[0].decode("ascii").strip()}')
|
||||
|
||||
# TODO: use a different way to find PNG files in stream
|
||||
magic_numbers = pngs.count(MAGIC_NUMBER)
|
||||
if magic_numbers == 1:
|
||||
|
Loading…
Reference in New Issue
Block a user