MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_get_attribute_error

Method test_get_attribute_error

test/ext/test_indexable.py:98–108  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 assert_raises(AttributeError, delattr, a, "first")
97
98 def test_get_attribute_error(self):
99 Base = declarative_base()
100
101 class A(Base):
102 __tablename__ = "a"
103 id = Column("id", Integer, primary_key=True)
104 array = Column("_array", ARRAY(Integer))
105 first = index_property("array", 1)
106
107 a = A(array=[])
108 assert_raises(AttributeError, lambda: a.first)
109
110 def test_set_immutable(self):
111 Base = declarative_base()

Callers

nothing calls this directly

Calls 3

declarative_baseFunction · 0.90
assert_raisesFunction · 0.90
AClass · 0.70

Tested by

no test coverage detected