diff --git a/tests/test_edge_cases.py b/tests/test_edge_cases.py index e2b313f..5716060 100644 --- a/tests/test_edge_cases.py +++ b/tests/test_edge_cases.py @@ -1005,3 +1005,15 @@ def test_values_attr_deprecation(): m = Model(foo=4, bar='baz') with pytest.warns(DeprecationWarning, match='`__values__` attribute is deprecated, use `__dict__` instead'): assert m.__values__ == m.__dict__ + + +def test_init_inspection(): + class Foobar(BaseModel): + x: int + + def __init__(self, **data) -> None: + with pytest.raises(AttributeError): + assert self.x + super().__init__(**data) + + Foobar(x=1)