(self)
| 379 | ) |
| 380 | |
| 381 | def test_del_scalar_nonobject(self): |
| 382 | class Foo: |
| 383 | pass |
| 384 | |
| 385 | instrumentation.register_class(Foo) |
| 386 | _register_attribute(Foo, "b", uselist=False, useobject=False) |
| 387 | |
| 388 | f1 = Foo() |
| 389 | |
| 390 | is_(f1.b, None) |
| 391 | |
| 392 | f1.b = 5 |
| 393 | |
| 394 | del f1.b |
| 395 | is_(f1.b, None) |
| 396 | |
| 397 | f1 = Foo() |
| 398 | |
| 399 | def go(): |
| 400 | del f1.b |
| 401 | |
| 402 | assert_raises_message( |
| 403 | AttributeError, "Foo.b object does not have a value", go |
| 404 | ) |
| 405 | |
| 406 | def test_del_scalar_object(self): |
| 407 | class Foo: |
nothing calls this directly
no test coverage detected