File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 11import subprocess
22import sys
33import tempfile
4+ from importlib .util import find_spec
45from pathlib import Path
56
67import pytest
78
8- try :
9- from PIL import Image , ImageDraw # noqa: F401
109
11- PIL_NOT_INSTALLED = False
12- except ImportError :
13- PIL_NOT_INSTALLED = True
10+ PIL_NOT_AVAILABLE = find_spec ("PIL" ) is None
1411
1512
1613def test_module_help ():
@@ -31,7 +28,7 @@ def test_module_help():
3128 assert "--factory" in result .stdout
3229
3330
34- @pytest .mark .skipif (PIL_NOT_INSTALLED , reason = "PIL is not installed" )
31+ @pytest .mark .skipif (PIL_NOT_AVAILABLE , reason = "PIL is not installed" )
3532def test_module_generate_qrcode ():
3633 """Test that the module can generate a QR code image."""
3734 with tempfile .TemporaryDirectory () as temp_dir :
You can’t perform that action at this time.
0 commit comments