gh-84461: Skip dtrace/network tests that are enabled by -u all (GH-93473)

This commit is contained in:
Christian Heimes 2022-06-03 22:14:31 +02:00 committed by GitHub
parent d52ffc1d1f
commit 1a8a0ddb1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -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)

View 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"))