diff --git a/qrcode/tests/test_qrcode_pypng.py b/qrcode/tests/test_qrcode_pypng.py index 0245b20..c502a3b 100644 --- a/qrcode/tests/test_qrcode_pypng.py +++ b/qrcode/tests/test_qrcode_pypng.py @@ -1,13 +1,16 @@ import io from unittest import mock -import png +import pytest + import qrcode import qrcode.util from qrcode.image.pure import PyPNGImage from qrcode.tests.consts import UNICODE_TEXT +png = pytest.importorskip("png", reason="png is not installed") + def test_render_pypng(): qr = qrcode.QRCode() diff --git a/qrcode/tests/test_script.py b/qrcode/tests/test_script.py index fbb8b28..5135b1f 100644 --- a/qrcode/tests/test_script.py +++ b/qrcode/tests/test_script.py @@ -48,6 +48,7 @@ def test_stdin_py3_unicodedecodeerror(): def test_optimize(): + pytest.importorskip("PyPNG", reason="Requires PyPNG") main("testtext --optimize 0".split())