MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_del_scalar_nonobject

Method test_del_scalar_nonobject

test/orm/test_attributes.py:381–404  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 4

is_Function · 0.90
assert_raises_messageFunction · 0.90
_register_attributeFunction · 0.70
FooClass · 0.70

Tested by

no test coverage detected