MCPcopy
hub / github.com/pydantic/pydantic / test_simple_pickle

Function test_simple_pickle

tests/test_construction.py:332–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

330
331
332def test_simple_pickle():
333 m = Model(a='24')
334 b = pickle.dumps(m)
335 m2 = pickle.loads(b)
336 assert m.a == m2.a == 24
337 assert m.b == m2.b == 10
338 assert m == m2
339 assert m is not m2
340 assert tuple(m) == (('a', 24.0), ('b', 10))
341 assert tuple(m2) == (('a', 24.0), ('b', 10))
342
343
344def test_recursive_pickle(create_module):

Callers

nothing calls this directly

Calls 1

ModelClass · 0.70

Tested by

no test coverage detected