Skip to content
Closed
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
8 changes: 5 additions & 3 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,12 @@ def baz():
check('def f(*):\n pass', 1, 7)

@support.requires_resource('cpu')
@support.bigmemtest(support._2G, memuse=1.5)
def testMemoryErrorBigSource(self, _size):
@support.bigmemtest(support._2G, memuse=2, dry_run=False)
def testMemoryErrorBigSource(self, size):
templ = f"if True:\n %{size}sprint('hello world')"
src = templ.encode() % b'' # bytes formatting is faster
with self.assertRaises(OverflowError):
exec(f"if True:\n {' ' * 2**31}print('hello world')")
compile(src, '<fragment>', 'exec')

@cpython_only
def testSettingException(self):
Expand Down