MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_no_mappers

Method test_no_mappers

test/orm/test_pickled.py:167–182  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

165 eq_(u1, sess.get(User, u2.id))
166
167 def test_no_mappers(self):
168 users = self.tables.users
169
170 self.mapper_registry.map_imperatively(User, users)
171 u1 = User(name="ed")
172 u1_pickled = pickle.dumps(u1, -1)
173
174 clear_mappers()
175
176 assert_raises_message(
177 orm_exc.UnmappedInstanceError,
178 "Cannot deserialize object of type "
179 "<class 'sqlalchemy.testing.pickleable.User'> - no mapper()",
180 pickle.loads,
181 u1_pickled,
182 )
183
184 def test_no_instrumentation(self):
185 users = self.tables.users

Callers

nothing calls this directly

Calls 5

UserClass · 0.90
clear_mappersFunction · 0.90
assert_raises_messageFunction · 0.90
map_imperativelyMethod · 0.80
dumpsMethod · 0.45

Tested by

no test coverage detected