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

Method test_break_outside_loop

Lib/test/test_syntax.py:2381–2391  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2379 "outside function")
2380
2381 def test_break_outside_loop(self):
2382 msg = "outside loop"
2383 self._check_error("break", msg, lineno=1)
2384 self._check_error("if 0: break", msg, lineno=1)
2385 self._check_error("if 0: break\nelse: x=1", msg, lineno=1)
2386 self._check_error("if 1: pass\nelse: break", msg, lineno=2)
2387 self._check_error("class C:\n if 0: break", msg, lineno=2)
2388 self._check_error("class C:\n if 1: pass\n else: break",
2389 msg, lineno=3)
2390 self._check_error("with object() as obj:\n break",
2391 msg, lineno=2)
2392
2393 @unittest.expectedFailure # TODO: RUSTPYTHON
2394 def test_continue_outside_loop(self):

Callers

nothing calls this directly

Calls 1

_check_errorMethod · 0.95

Tested by

no test coverage detected