Skip to content

Commit

Permalink
pythongh-84461: Skip dtrace/network tests that are enabled by -u all (p…
Browse files Browse the repository at this point in the history
…ythonGH-93473)

(cherry picked from commit 1a8a0dd)

Co-authored-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran authored and miss-islington committed Jun 3, 2022
1 parent fae93ab commit e614e95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 5 additions & 0 deletions Lib/test/test_dtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
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"))

Expand Down

0 comments on commit e614e95

Please sign in to comment.