Skip to content

Commit 3489991

Browse files
committed
Rewrite tests in py.test format
1 parent 6ddd6df commit 3489991

File tree

7 files changed

+622
-586
lines changed

7 files changed

+622
-586
lines changed

qrcode/tests/test_example.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import unittest
21
from unittest import mock
32

3+
import pytest
4+
45
from qrcode import run_example
5-
from qrcode.compat.pil import Image
66

7+
pytest.importorskip("PIL", reason="Requires PIL")
78

8-
class ExampleTest(unittest.TestCase):
9-
@unittest.skipIf(not Image, "Requires PIL")
10-
@mock.patch("PIL.Image.Image.show")
11-
def runTest(self, mock_show):
12-
run_example()
13-
mock_show.assert_called_with()
9+
@mock.patch("PIL.Image.Image.show")
10+
def runTest(mock_show):
11+
run_example()
12+
mock_show.assert_called_with()

0 commit comments

Comments
 (0)