Skip to content

Commit 522b6d1

Browse files
committed
Disable ICMP tests on Ubuntu in GitHub.
Ref actions/runner-images#11614; Closes #9
1 parent 359ee74 commit 522b6d1

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

conftest.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ def pywin32_missing():
1919
importlib.import_module('win32service')
2020

2121

22+
def old_ping_exception():
23+
"""
24+
Ping test has different exception on older Pythons.
25+
"""
26+
return sys.version_info < (3, 10)
27+
28+
29+
def broken_actions_runner():
30+
"""
31+
Is unprivileged ICMP unavailable?
32+
33+
Since Dec 2024, GitHub Actions runners no longer seem
34+
to be able to allow unprivileged ICMP.
35+
36+
actions/runner-images#11614
37+
"""
38+
return bool(os.environ.get('GITHUB_ACTIONS')) and os.environ['RUNNER_OS'] == 'Linux'
39+
40+
2241
collect_ignore = (
2342
[
2443
'jaraco/net/devices/linux.py',
@@ -31,10 +50,9 @@ def pywin32_missing():
3150
]
3251
* pywin32_missing()
3352
+ [
34-
# ping test has different exception on older Pythons
3553
'jaraco/net/icmp.py',
3654
]
37-
* (sys.version_info < (3, 10))
55+
* (old_ping_exception() or broken_actions_runner())
3856
)
3957

4058

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extras =
1414
type
1515
passenv =
1616
GITHUB_ACTIONS
17+
RUNNER_OS
1718

1819
[testenv:diffcov]
1920
description = run tests and check that diff from main is covered

0 commit comments

Comments
 (0)