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

Method assert_syntax_error

Lib/test/test_patma.py:2897–2899  ·  view source on GitHub ↗
(self, code: str)

Source from the content-addressed store, hash-verified

2895class TestSyntaxErrors(unittest.TestCase):
2896
2897 def assert_syntax_error(self, code: str):
2898 with self.assertRaises(SyntaxError):
2899 compile(inspect.cleandoc(code), "<test>", "exec")
2900
2901 def test_alternative_patterns_bind_different_names_0(self):
2902 self.assert_syntax_error("""

Calls 2

compileFunction · 0.50
assertRaisesMethod · 0.45

Tested by

no test coverage detected