From 5fcc204c95665be389cf45ed2e0fd345a88d7184 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 30 Jan 2024 14:24:50 -0800 Subject: [PATCH 1/3] Set a lower recursion limit for `test_runpy.RunPathTestCase.test_main_recursion_error` --- Lib/test/test_runpy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py index 57fe859e366b5b..9d76764c75be3e 100644 --- a/Lib/test/test_runpy.py +++ b/Lib/test/test_runpy.py @@ -12,7 +12,8 @@ import textwrap import unittest import warnings -from test.support import no_tracing, verbose, requires_subprocess, requires_resource +from test.support import (infinite_recursion, no_tracing, verbose, + requires_subprocess, requires_resource) from test.support.import_helper import forget, make_legacy_pyc, unload from test.support.os_helper import create_empty_file, temp_dir from test.support.script_helper import make_script, make_zip_script @@ -743,7 +744,8 @@ def test_main_recursion_error(self): "runpy.run_path(%r)\n") % dummy_dir script_name = self._make_test_script(script_dir, mod_name, source) zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name) - self.assertRaises(RecursionError, run_path, zip_name) + with infinite_recursion(25): + self.assertRaises(RecursionError, run_path, zip_name) def test_encoding(self): with temp_dir() as script_dir: From b37f08b5da679ceeae7751bbd83465e2f5353c24 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 30 Jan 2024 14:25:25 -0800 Subject: [PATCH 2/3] Ignore test files put directly into the checkout --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 18eb2a9f0632ce..a231f10932393c 100644 --- a/.gitignore +++ b/.gitignore @@ -159,5 +159,8 @@ Python/frozen_modules/MANIFEST /python !/Python/ -# main branch only: ABI files are not checked/maintained +# main branch only: ABI files are not checked/maintained. Doc/data/python*.abi + +# Temp test files when e.g. /tmp is not available. +tmp*/ From 094ce4900e6a108da47093a66d870a7e6a2019e3 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 30 Jan 2024 16:07:08 -0800 Subject: [PATCH 3/3] Revert the .gitignore change --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index a231f10932393c..6ed7197e3ab626 100644 --- a/.gitignore +++ b/.gitignore @@ -161,6 +161,3 @@ Python/frozen_modules/MANIFEST # main branch only: ABI files are not checked/maintained. Doc/data/python*.abi - -# Temp test files when e.g. /tmp is not available. -tmp*/