MCPcopy
hub / github.com/pydantic/pydantic / test_copy_undefined

Function test_copy_undefined

tests/test_construction.py:396–403  ·  view source on GitHub ↗
(ModelTwo, copy_method)

Source from the content-addressed store, hash-verified

394
395
396def test_copy_undefined(ModelTwo, copy_method):
397 m = ModelTwo(a=24, d=Model(a='123.45'))
398 m2 = copy_method(m)
399 assert m2._foo_ == {'private'}
400
401 m._foo_ = PydanticUndefined
402 m3 = copy_method(m)
403 assert not hasattr(m3, '_foo_')
404
405
406def test_immutable_copy_with_frozen(copy_method):

Callers

nothing calls this directly

Calls 3

copy_methodFunction · 0.85
ModelTwoClass · 0.70
ModelClass · 0.70

Tested by

no test coverage detected