MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_no_instrumentation

Method test_no_instrumentation

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

Source from the content-addressed store, hash-verified

167 )
168
169 def test_no_instrumentation(self):
170 users = self.tables.users
171
172 self.mapper_registry.map_imperatively(User, users)
173 u1 = User(name="ed")
174 u1_pickled = pickle.dumps(u1, -1)
175
176 clear_mappers()
177
178 self.mapper_registry.map_imperatively(User, users)
179
180 u1 = pickle.loads(u1_pickled)
181 # this fails unless the InstanceState
182 # compiles the mapper
183 eq_(str(u1), "User(name='ed')")
184
185 def test_class_deferred_cols(self):
186 addresses, users = (self.tables.addresses, self.tables.users)

Callers

nothing calls this directly

Calls 6

UserClass · 0.90
clear_mappersFunction · 0.90
eq_Function · 0.90
map_imperativelyMethod · 0.80
dumpsMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected