This should only be used to make calls to the deprecated `copy` method with arguments that have been removed from `model_copy`. Otherwise, use the `copy_method` fixture below
(m: BaseModel, *, include=None, exclude=None, update=None, deep=False)
| 110 | |
| 111 | |
| 112 | def deprecated_copy(m: BaseModel, *, include=None, exclude=None, update=None, deep=False): |
| 113 | """ |
| 114 | This should only be used to make calls to the deprecated `copy` method with arguments |
| 115 | that have been removed from `model_copy`. Otherwise, use the `copy_method` fixture below |
| 116 | """ |
| 117 | with pytest.warns( |
| 118 | PydanticDeprecatedSince20, |
| 119 | match=( |
| 120 | 'The `copy` method is deprecated; use `model_copy` instead. ' |
| 121 | 'See the docstring of `BaseModel.copy` for details about how to handle `include` and `exclude`.' |
| 122 | ), |
| 123 | ): |
| 124 | return m.copy(include=include, exclude=exclude, update=update, deep=deep) |
| 125 | |
| 126 | |
| 127 | @pytest.fixture(params=['copy', 'model_copy']) |
no test coverage detected