From 9bd41dba1ecab80bf3e8b56195cf4d173acbaa80 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Tue, 4 Aug 2020 23:54:11 +0200 Subject: [PATCH] src/img2pdf_test.py: check that psnr is not zero --- src/img2pdf_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/img2pdf_test.py b/src/img2pdf_test.py index 1ad0a70..02b797a 100644 --- a/src/img2pdf_test.py +++ b/src/img2pdf_test.py @@ -287,6 +287,7 @@ def compare_ghostscript(tmpdir, img, pdf, gsdevice="png16m", exact=True): check=False, stderr=subprocess.PIPE, ).stderr + assert psnr != b"0" psnr = float(psnr.strip(b"0")) assert psnr != 0 # or otherwise we would use the exact variant assert psnr > 50 @@ -321,6 +322,7 @@ def compare_poppler(tmpdir, img, pdf, exact=True): check=False, stderr=subprocess.PIPE, ).stderr + assert psnr != b"0" psnr = float(psnr.strip(b"0")) assert psnr != 0 # or otherwise we would use the exact variant assert psnr > 50 @@ -350,6 +352,7 @@ def compare_mupdf(tmpdir, img, pdf, exact=True, cmyk=False): check=False, stderr=subprocess.PIPE, ).stderr + assert psnr != b"0" psnr = float(psnr.strip(b"0")) assert psnr != 0 # or otherwise we would use the exact variant assert psnr > 50 @@ -410,6 +413,7 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True): check=False, stderr=subprocess.PIPE, ).stderr + assert psnr != b"0" psnr = float(psnr.strip(b"0")) assert psnr != 0 # or otherwise we would use the exact variant assert psnr > 50