summaryrefslogtreecommitdiff
path: root/Lib/test/test_faulthandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r--Lib/test/test_faulthandler.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index ee3f41a108..e0f09e821d 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -6,10 +6,10 @@ import re
import signal
import subprocess
import sys
-import sysconfig
from test import support
from test.support import os_helper
from test.support import script_helper, is_android
+from test.support import skip_if_sanitizer
import tempfile
import unittest
from textwrap import dedent
@@ -21,16 +21,6 @@ except ImportError:
TIMEOUT = 0.5
MS_WINDOWS = (os.name == 'nt')
-_cflags = sysconfig.get_config_var('CFLAGS') or ''
-_config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
-UB_SANITIZER = (
- '-fsanitize=undefined' in _cflags or
- '--with-undefined-behavior-sanitizer' in _config_args
-)
-MEMORY_SANITIZER = (
- '-fsanitize=memory' in _cflags or
- '--with-memory-sanitizer' in _config_args
-)
def expected_traceback(lineno1, lineno2, header, min_count=1):
@@ -310,8 +300,8 @@ class FaultHandlerTests(unittest.TestCase):
3,
'Segmentation fault')
- @unittest.skipIf(UB_SANITIZER or MEMORY_SANITIZER,
- "sanitizer builds change crashing process output.")
+ @skip_if_sanitizer(memory=True, ub=True, reason="sanitizer "
+ "builds change crashing process output.")
@skip_segfault_on_android
def test_enable_file(self):
with temporary_filename() as filename:
@@ -327,8 +317,8 @@ class FaultHandlerTests(unittest.TestCase):
@unittest.skipIf(sys.platform == "win32",
"subprocess doesn't support pass_fds on Windows")
- @unittest.skipIf(UB_SANITIZER or MEMORY_SANITIZER,
- "sanitizer builds change crashing process output.")
+ @skip_if_sanitizer(memory=True, ub=True, reason="sanitizer "
+ "builds change crashing process output.")
@skip_segfault_on_android
def test_enable_fd(self):
with tempfile.TemporaryFile('wb+') as fp: