MCPcopy Index your code
hub / github.com/python/cpython / raises_syntax_or_memory_error

Method raises_syntax_or_memory_error

Lib/test/test_fstring.py:635–645  ·  view source on GitHub ↗
(txt)

Source from the content-addressed store, hash-verified

633 @unittest.skipIf(support.is_wasi, "exhausts limited stack on WASI")
634 def test_fstring_nested_too_deeply(self):
635 def raises_syntax_or_memory_error(txt):
636 try:
637 eval(txt)
638 except SyntaxError:
639 pass
640 except MemoryError:
641 pass
642 except Exception as ex:
643 self.fail(f"Should raise SyntaxError or MemoryError, not {type(ex)}")
644 else:
645 self.fail("No exception raised")
646
647 raises_syntax_or_memory_error('f"{1+2:{1+2:{1+1:{1}}}}"')
648

Callers

nothing calls this directly

Calls 1

failMethod · 0.95

Tested by

no test coverage detected