MCPcopy
hub / github.com/pydantic/pydantic / test_fields_set

Function test_fields_set

tests/test_deprecated.py:346–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344
345
346def test_fields_set():
347 class Model(BaseModel):
348 x: int
349 y: int = 2
350
351 m = Model(x=1)
352 assert m.model_fields_set == {'x'}
353 match = '^The `__fields_set__` attribute is deprecated, use `model_fields_set` instead.'
354 with pytest.warns(PydanticDeprecatedSince20, match=match):
355 assert m.__fields_set__ == {'x'}
356
357
358def test_fields_dir():

Callers

nothing calls this directly

Calls 1

ModelClass · 0.70

Tested by

no test coverage detected