summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_regrtest.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-05 12:42:36 (GMT)
committerGitHub <noreply@github.com>2023-10-05 12:42:36 (GMT)
commitaf29282fce117cb10f00907fd46d56c2fa6142f5 (patch)
tree303d805736f0d391d7c8f11b3305f6e43bd5473e /Lib/test/test_regrtest.py
parent2bbbab212fb10b3aeaded188fb5d6c001fb4bf74 (diff)
downloadcpython-af29282fce117cb10f00907fd46d56c2fa6142f5.zip
cpython-af29282fce117cb10f00907fd46d56c2fa6142f5.tar.gz
cpython-af29282fce117cb10f00907fd46d56c2fa6142f5.tar.bz2
gh-110367: Fix regrtest test_worker_output_on_failure() on ASAN build (#110387)
Set ASAN_OPTIONS="handle_segv=0" env var to run the test.
Diffstat (limited to 'Lib/test/test_regrtest.py')
-rw-r--r--Lib/test/test_regrtest.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 66463fd..de2c431 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -674,7 +674,7 @@ class BaseTestCase(unittest.TestCase):
if 'stderr' not in kw:
kw['stderr'] = subprocess.STDOUT
proc = subprocess.run(args,
- universal_newlines=True,
+ text=True,
input=input,
stdout=subprocess.PIPE,
**kw)
@@ -756,8 +756,8 @@ class ProgramsTestCase(BaseTestCase):
self.check_executed_tests(output, self.tests,
randomize=True, stats=len(self.tests))
- def run_tests(self, args):
- output = self.run_python(args)
+ def run_tests(self, args, env=None):
+ output = self.run_python(args, env=env)
self.check_output(output)
def test_script_regrtest(self):
@@ -2061,7 +2061,14 @@ class ArgsTestCase(BaseTestCase):
""")
testname = self.create_test(code=code)
- output = self.run_tests("-j1", testname, exitcode=EXITCODE_BAD_TEST)
+ # Sanitizers must not handle SIGSEGV (ex: for test_enable_fd())
+ env = dict(os.environ)
+ option = 'handle_segv=0'
+ support.set_sanitizer_env_var(env, option)
+
+ output = self.run_tests("-j1", testname,
+ exitcode=EXITCODE_BAD_TEST,
+ env=env)
self.check_executed_tests(output, testname,
failed=[testname],
stats=0, parallel=True)