MCPcopy
hub / github.com/pydantic/pydantic / copy_method

Function copy_method

tests/test_construction.py:128–139  ·  view source on GitHub ↗

Fixture to test both the old/deprecated `copy` and new `model_copy` methods.

(request)

Source from the content-addressed store, hash-verified

126
127@pytest.fixture(params=['copy', 'model_copy'])
128def copy_method(request):
129 """
130 Fixture to test both the old/deprecated `copy` and new `model_copy` methods.
131 """
132 if request.param == 'copy':
133 return deprecated_copy
134 else:
135
136 def new_copy_method(m, *, update=None, deep=False):
137 return m.model_copy(update=update, deep=deep)
138
139 return new_copy_method
140
141
142def test_simple_copy(copy_method):

Callers 9

test_simple_copyFunction · 0.85
test_deep_copyFunction · 0.85
test_copy_updateFunction · 0.85
test_copy_update_unsetFunction · 0.85
test_copy_deep_extraFunction · 0.85
test_copy_set_fieldsFunction · 0.85
test_copy_undefinedFunction · 0.85
test_shallow_copy_modifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected