|
5 | 5 | from .helper import assert_image_equal_tofile, assert_image_similar_tofile |
6 | 6 |
|
7 | 7 |
|
8 | | -class TestFileQOI: |
9 | | - def test_sanity(self): |
10 | | - with Image.open("Tests/images/hopper.qoi") as im: |
11 | | - assert im.mode == "RGB" |
12 | | - assert im.size == (128, 128) |
13 | | - assert im.format == "QOI" |
| 8 | +def test_sanity(): |
| 9 | + with Image.open("Tests/images/hopper.qoi") as im: |
| 10 | + assert im.mode == "RGB" |
| 11 | + assert im.size == (128, 128) |
| 12 | + assert im.format == "QOI" |
14 | 13 |
|
15 | | - assert_image_equal_tofile(im, "Tests/images/hopper.png") |
| 14 | + assert_image_equal_tofile(im, "Tests/images/hopper.png") |
16 | 15 |
|
17 | | - with Image.open("Tests/images/pil123rgba.qoi") as im: |
18 | | - assert im.mode == "RGBA" |
19 | | - assert im.size == (162, 150) |
20 | | - assert im.format == "QOI" |
| 16 | + with Image.open("Tests/images/pil123rgba.qoi") as im: |
| 17 | + assert im.mode == "RGBA" |
| 18 | + assert im.size == (162, 150) |
| 19 | + assert im.format == "QOI" |
21 | 20 |
|
22 | | - assert_image_similar_tofile(im, "Tests/images/pil123rgba.png", 0.03) |
| 21 | + assert_image_similar_tofile(im, "Tests/images/pil123rgba.png", 0.03) |
23 | 22 |
|
24 | | - def test_invalid_file(self): |
25 | | - invalid_file = "Tests/images/flower.jpg" |
26 | 23 |
|
27 | | - with pytest.raises(SyntaxError): |
28 | | - QoiImagePlugin.QoiImageFile(invalid_file) |
| 24 | +def test_invalid_file(): |
| 25 | + invalid_file = "Tests/images/flower.jpg" |
| 26 | + |
| 27 | + with pytest.raises(SyntaxError): |
| 28 | + QoiImagePlugin.QoiImageFile(invalid_file) |
0 commit comments