Skip to content

Commit e4113be

Browse files
gh-84461: Skip dtrace/network tests that are enabled by -u all (GH-93473)
(cherry picked from commit 1a8a0dd) Co-authored-by: Christian Heimes <[email protected]>
1 parent fae93ab commit e4113be

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Lib/test/support/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ def requires(resource, msg=None):
304304
if msg is None:
305305
msg = "Use of the %r resource not enabled" % resource
306306
raise ResourceDenied(msg)
307+
if resource in {"network", "urlfetch"} and not has_socket_support:
308+
raise ResourceDenied("No socket support")
307309
if resource == 'gui' and not _is_gui_available():
308310
raise ResourceDenied(_is_gui_available.reason)
309311

Lib/test/test_dtrace.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
import types
77
import unittest
88

9+
from test import support
910
from test.support import findfile
1011

1112

13+
if not support.has_subprocess_support:
14+
raise unittest.SkipTest("test module requires subprocess")
15+
16+
1217
def abspath(filename):
1318
return os.path.abspath(findfile(filename, subdir="dtracedata"))
1419

0 commit comments

Comments
 (0)