diff options
-rw-r--r-- | Lib/test/support/__init__.py | 2 | ||||
-rw-r--r-- | Lib/test/test_dtrace.py | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index e23ffee..780d04b 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -305,6 +305,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) diff --git a/Lib/test/test_dtrace.py b/Lib/test/test_dtrace.py index 8a436ad..4b971de 100644 --- a/Lib/test/test_dtrace.py +++ b/Lib/test/test_dtrace.py @@ -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")) |