Skip to content

Commit 137946a

Browse files
committed
Fix import errors in tests
1 parent 5405643 commit 137946a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

qrcode/tests/test_qrcode_pypng.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import io
22
from unittest import mock
33

4-
import png
4+
import pytest
5+
56

67
import qrcode
78
import qrcode.util
89
from qrcode.image.pure import PyPNGImage
910
from qrcode.tests.consts import UNICODE_TEXT
1011

12+
png = pytest.importorskip("png", reason="png is not installed")
13+
1114

1215
def test_render_pypng():
1316
qr = qrcode.QRCode()

qrcode/tests/test_script.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_stdin_py3_unicodedecodeerror():
4848

4949

5050
def test_optimize():
51+
pytest.importorskip("PyPNG", reason="Requires PyPNG")
5152
main("testtext --optimize 0".split())
5253

5354

0 commit comments

Comments
 (0)