MCPcopy
hub / github.com/pydantic/pydantic / test_copy_preserves_equality

Function test_copy_preserves_equality

tests/test_root_model.py:617–627  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

615
616
617def test_copy_preserves_equality():
618 class Root(RootModel[int]):
619 pass
620
621 root_model = Root(1)
622
623 copied = root_model.model_copy()
624 assert root_model == copied
625
626 deepcopied = root_model.model_copy(deep=True)
627 assert root_model == deepcopied
628
629
630def test_root_model_shallow_copy() -> None:

Callers

nothing calls this directly

Calls 2

model_copyMethod · 0.80
RootClass · 0.70

Tested by

no test coverage detected