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

Method test_assign_del

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

Source from the content-addressed store, hash-verified

2301
2302 @unittest.expectedFailure # TODO: RUSTPYTHON
2303 def test_assign_del(self):
2304 self._check_error("del (,)", "invalid syntax")
2305 self._check_error("del 1", "cannot delete literal")
2306 self._check_error("del (1, 2)", "cannot delete literal")
2307 self._check_error("del None", "cannot delete None")
2308 self._check_error("del *x", "cannot delete starred")
2309 self._check_error("del (*x)", "cannot use starred expression")
2310 self._check_error("del (*x,)", "cannot delete starred")
2311 self._check_error("del [*x,]", "cannot delete starred")
2312 self._check_error("del f()", "cannot delete function call")
2313 self._check_error("del f(a, b)", "cannot delete function call")
2314 self._check_error("del o.f()", "cannot delete function call")
2315 self._check_error("del a[0]()", "cannot delete function call")
2316 self._check_error("del x, f()", "cannot delete function call")
2317 self._check_error("del f(), x", "cannot delete function call")
2318 self._check_error("del [a, b, ((c), (d,), e.f())]", "cannot delete function call")
2319 self._check_error("del (a if True else b)", "cannot delete conditional")
2320 self._check_error("del +a", "cannot delete expression")
2321 self._check_error("del a, +b", "cannot delete expression")
2322 self._check_error("del a + b", "cannot delete expression")
2323 self._check_error("del (a + b, c)", "cannot delete expression")
2324 self._check_error("del (c[0], a + b)", "cannot delete expression")
2325 self._check_error("del a.b.c + 2", "cannot delete expression")
2326 self._check_error("del a.b.c[0] + 2", "cannot delete expression")
2327 self._check_error("del (a, b, (c, d.e.f + 2))", "cannot delete expression")
2328 self._check_error("del [a, b, (c, d.e.f[0] + 2)]", "cannot delete expression")
2329 self._check_error("del (a := 5)", "cannot delete named expression")
2330 # We don't have a special message for this, but make sure we don't
2331 # report "cannot delete name"
2332 self._check_error("del a += b", "invalid syntax")
2333
2334 def test_global_param_err_first(self):
2335 source = """if 1:

Callers

nothing calls this directly

Calls 1

_check_errorMethod · 0.95

Tested by

no test coverage detected