Skip to content

Commit

Permalink
Set a lower recursion limit for `test_runpy.RunPathTestCase.test_main…
Browse files Browse the repository at this point in the history
…_recursion_error`
  • Loading branch information
brettcannon committed Jan 30, 2024
1 parent 8612230 commit 5fcc204
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/test/test_runpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5fcc204

Please sign in to comment.