]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-84461: Skip dtrace/network tests that are enabled by -u all (GH-93473)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 3 Jun 2022 20:40:20 +0000 (13:40 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Jun 2022 20:40:20 +0000 (13:40 -0700)
(cherry picked from commit 1a8a0ddb1c62ef9aff598e7e3e3a65cf35353932)

Co-authored-by: Christian Heimes <christian@python.org>
Lib/test/support/__init__.py
Lib/test/test_dtrace.py

index 513ada7cb1f3d7d0e17c0ef87cb2baabc7e97b9a..35c4efb01af27f1e79a8368dff0d676b2983a329 100644 (file)
@@ -304,6 +304,8 @@ def requires(resource, msg=None):
         if msg is None:
             msg = "Use of the %r resource not enabled" % resource
         raise ResourceDenied(msg)
+    if resource in {"network", "urlfetch"} and not has_socket_support:
+        raise ResourceDenied("No socket support")
     if resource == 'gui' and not _is_gui_available():
         raise ResourceDenied(_is_gui_available.reason)
 
index 8a436ad123b80f7e8d6355ffaf6adb90212fa8c3..4b971deacc1a5c28a2ef3390c4e04b5b5deaf32d 100644 (file)
@@ -6,9 +6,14 @@ import sys
 import types
 import unittest
 
+from test import support
 from test.support import findfile
 
 
+if not support.has_subprocess_support:
+    raise unittest.SkipTest("test module requires subprocess")
+
+
 def abspath(filename):
     return os.path.abspath(findfile(filename, subdir="dtracedata"))