MCPcopy
hub / github.com/pydantic/pydantic / test_model_copy

Function test_model_copy

tests/test_construction.py:535–546  ·  view source on GitHub ↗
(ModelTwo)

Source from the content-addressed store, hash-verified

533
534
535def test_model_copy(ModelTwo):
536 m = ModelTwo(a=24, d=Model(a='12'))
537 m2 = m.__copy__()
538 assert m is not m2
539
540 assert m.a == m2.a == 24
541 assert isinstance(m2.d, Model)
542 assert m.d is m2.d
543 assert m.d.a == m2.d.a == 12
544
545 m.a = 12
546 assert m.a != m2.a
547
548
549def test_pydantic_extra():

Callers

nothing calls this directly

Calls 3

ModelTwoClass · 0.70
ModelClass · 0.70
__copy__Method · 0.45

Tested by

no test coverage detected