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

Method test_no_instrumentation

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

Source from the content-addressed store, hash-verified

182 )
183
184 def test_no_instrumentation(self):
185 users = self.tables.users
186
187 self.mapper_registry.map_imperatively(User, users)
188 u1 = User(name="ed")
189 u1_pickled = pickle.dumps(u1, -1)
190
191 clear_mappers()
192
193 self.mapper_registry.map_imperatively(User, users)
194
195 u1 = pickle.loads(u1_pickled)
196 # this fails unless the InstanceState
197 # compiles the mapper
198 eq_(str(u1), "User(name='ed')")
199
200 def test_class_deferred_cols(self):
201 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