()
| 348 | |
| 349 | |
| 350 | def test_assign_extra_validate(): |
| 351 | class Model(BaseModel): |
| 352 | model_config = ConfigDict(validate_assignment=True) |
| 353 | a: float |
| 354 | |
| 355 | model = Model(a=0.2) |
| 356 | with pytest.raises(ValidationError, match=r"b\s+Object has no attribute 'b'"): |
| 357 | model.b = 2 |
| 358 | |
| 359 | |
| 360 | def test_model_property_attribute_error(): |