MCPcopy
hub / github.com/pydantic/pydantic / test_root_model_deep_copy

Function test_root_model_deep_copy

tests/test_root_model.py:647–657  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

645
646
647def test_root_model_deep_copy() -> None:
648 class NestedListRootModel(RootModel[list[list[int]]]):
649 pass
650
651 original = NestedListRootModel([[1, 2], [3, 4]])
652 copied = original.model_copy(deep=True)
653
654 assert original is not copied
655 assert original.root is not copied.root
656 assert original.root[0] is not copied.root[0]
657 assert original.root == copied.root
658
659
660@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

NestedListRootModelClass · 0.85
model_copyMethod · 0.80

Tested by

no test coverage detected