Test error message when assignment target is invalid.
()
| 335 | |
| 336 | |
| 337 | def test_eval_error_invalid_assignment() -> None: |
| 338 | """Test error message when assignment target is invalid.""" |
| 339 | ds = Dataset({"a": ("x", [1, 2, 3])}) |
| 340 | # "1 = a" should fail during parsing - can't assign to a literal |
| 341 | with pytest.raises(ValueError, match="Invalid"): |
| 342 | ds.eval("1 = a") |
| 343 | |
| 344 | |
| 345 | def test_eval_error_dunder_access() -> None: |