(self)
| 404 | ) |
| 405 | |
| 406 | def test_del_scalar_object(self): |
| 407 | class Foo: |
| 408 | pass |
| 409 | |
| 410 | class Bar: |
| 411 | pass |
| 412 | |
| 413 | instrumentation.register_class(Foo) |
| 414 | instrumentation.register_class(Bar) |
| 415 | _register_attribute(Foo, "b", uselist=False, useobject=True) |
| 416 | |
| 417 | f1 = Foo() |
| 418 | |
| 419 | is_(f1.b, None) |
| 420 | |
| 421 | f1.b = Bar() |
| 422 | |
| 423 | del f1.b |
| 424 | is_(f1.b, None) |
| 425 | |
| 426 | def go(): |
| 427 | del f1.b |
| 428 | |
| 429 | assert_raises_message( |
| 430 | AttributeError, "Foo.b object does not have a value", go |
| 431 | ) |
| 432 | |
| 433 | def test_del_collection_object(self): |
| 434 | class Foo: |
nothing calls this directly
no test coverage detected