Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-98894: Skip test_dtrace when building without dtrace (GH-152239)
(cherry picked from commit 6713576)

Co-authored-by: stratakis <cstratak@redhat.com>
  • Loading branch information
stratakis authored and miss-islington committed Jun 26, 2026
commit ad7a1f5dd8f59c6e9ff446b49f1f0a352a1d2504
13 changes: 7 additions & 6 deletions Lib/test/test_dtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

if not support.has_subprocess_support:
raise unittest.SkipTest("test module requires subprocess")
if not sysconfig.get_config_var('WITH_DTRACE'):
raise unittest.SkipTest(
"CPython must be configured with the --with-dtrace option."
)


def abspath(filename):
Expand Down Expand Up @@ -178,12 +182,9 @@ class SystemTapOptimizedTests(TraceTests, unittest.TestCase):
class CheckDtraceProbes(unittest.TestCase):
@classmethod
def setUpClass(cls):
if sysconfig.get_config_var('WITH_DTRACE'):
readelf_major_version, readelf_minor_version = cls.get_readelf_version()
if support.verbose:
print(f"readelf version: {readelf_major_version}.{readelf_minor_version}")
else:
raise unittest.SkipTest("CPython must be configured with the --with-dtrace option.")
readelf_major_version, readelf_minor_version = cls.get_readelf_version()
if support.verbose:
print(f"readelf version: {readelf_major_version}.{readelf_minor_version}")


@staticmethod
Expand Down