MCPcopy Index your code
hub / github.com/RustPython/RustPython / raises_syntax_or_memory_error

Method raises_syntax_or_memory_error

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

failMethod · 0.95
evalFunction · 0.50

Tested by

no test coverage detected