Skip to content

Commit

Permalink
do not report missing coverage for lines skipping tests on Windows in…
Browse files Browse the repository at this point in the history
… Docker
  • Loading branch information
nulano committed Nov 27, 2023
1 parent 955ba82 commit bf393c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def djpeg_available():
try:
subprocess.check_call(["djpeg", "-version"])
return True
except subprocess.CalledProcessError:
except subprocess.CalledProcessError: # pragma: no cover
return False


Expand All @@ -272,7 +272,7 @@ def cjpeg_available():
try:
subprocess.check_call(["cjpeg", "-version"])
return True
except subprocess.CalledProcessError:
except subprocess.CalledProcessError: # pragma: no cover
return False


Expand Down
3 changes: 2 additions & 1 deletion Tests/test_imagegrab.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class TestImageGrab:
sys.platform not in ("win32", "darwin"), reason="requires Windows or macOS"
)
def test_grab(self):
if os.environ.get("USERNAME") == "ContainerAdministrator":
if os.environ.get("USERNAME") == "ContainerAdministrator": # pragma: no cover
pytest.skip("can't grab screen when running in Docker")

ImageGrab.grab()
ImageGrab.grab(include_layered_windows=True)
ImageGrab.grab(all_screens=True)
Expand Down

0 comments on commit bf393c3

Please sign in to comment.