Skip to content

Commit c10446f

Browse files
nulanohugovk
andcommitted
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 02920fe commit c10446f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.github/workflows/wheels.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
path: Tests\test-images
9797
- uses: actions/setup-python@v4
9898
with:
99-
python-version: "3.11"
99+
python-version: "3.x"
100100
- name: Prepare for build
101101
run: |
102102
choco install nasm --no-progress
@@ -137,14 +137,13 @@ jobs:
137137
CIBW_BEFORE_ALL: "{package}\\winbuild\\build\\build_dep_all.cmd"
138138
CIBW_CACHE_PATH: "C:\\cibw"
139139
CIBW_TEST_SKIP: "*-win_arm64"
140-
CIBW_TEST_COMMAND: >-
141-
docker run --rm
140+
CIBW_TEST_COMMAND: 'docker run --rm
142141
-v {project}:C:\pillow
143142
-v C:\cibw:C:\cibw
144143
-v %CD%\..\venv-test:%CD%\..\venv-test
145144
-e CI -e GITHUB_ACTIONS
146145
mcr.microsoft.com/windows/servercore:ltsc2022
147-
powershell C:\pillow\.github\workflows\wheels-test.ps1 %CD%\..\venv-test
146+
powershell C:\pillow\.github\workflows\wheels-test.ps1 %CD%\..\venv-test'
148147
shell: cmd
149148
- name: Upload wheels
150149
uses: actions/upload-artifact@v3

Tests/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def djpeg_available():
263263
try:
264264
subprocess.check_call(["djpeg", "-version"])
265265
return True
266-
except subprocess.CalledProcessError:
266+
except subprocess.CalledProcessError: # pragma: no cover
267267
return False
268268

269269

@@ -272,7 +272,7 @@ def cjpeg_available():
272272
try:
273273
subprocess.check_call(["cjpeg", "-version"])
274274
return True
275-
except subprocess.CalledProcessError:
275+
except subprocess.CalledProcessError: # pragma: no cover
276276
return False
277277

278278

Tests/test_imagegrab.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212

1313
class TestImageGrab:
14+
@pytest.mark.skipif(
15+
os.environ.get("USERNAME") == "ContainerAdministrator",
16+
reason="can't grab screen when running in Docker",
17+
)
1418
@pytest.mark.skipif(
1519
sys.platform not in ("win32", "darwin"), reason="requires Windows or macOS"
1620
)
1721
def test_grab(self):
18-
if os.environ.get("USERNAME") == "ContainerAdministrator":
19-
pytest.skip("can't grab screen when running in Docker")
2022
ImageGrab.grab()
2123
ImageGrab.grab(include_layered_windows=True)
2224
ImageGrab.grab(all_screens=True)

0 commit comments

Comments
 (0)