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

Method test_nonlocal_param_err_first

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

Source from the content-addressed store, hash-verified

2342 self._check_error(source, "parameter and global", lineno=3)
2343
2344 def test_nonlocal_param_err_first(self):
2345 source = """if 1:
2346 def error(a):
2347 nonlocal a # SyntaxError
2348 def error2():
2349 b = 1
2350 global b # SyntaxError
2351 """
2352 self._check_error(source, "parameter and nonlocal", lineno=3)
2353
2354 def test_yield_outside_function(self):
2355 self._check_error("if 0: yield", "outside function")

Callers

nothing calls this directly

Calls 1

_check_errorMethod · 0.95

Tested by

no test coverage detected