(model_type: type[BaseModel], obj: Any)
| 38 | |
| 39 | |
| 40 | def deprecated_from_orm(model_type: type[BaseModel], obj: Any) -> Any: |
| 41 | with pytest.warns( |
| 42 | PydanticDeprecatedSince20, |
| 43 | match=re.escape( |
| 44 | "The `from_orm` method is deprecated; set `model_config['from_attributes']=True` " |
| 45 | 'and use `model_validate` instead.' |
| 46 | ), |
| 47 | ): |
| 48 | return model_type.from_orm(obj) |
| 49 | |
| 50 | |
| 51 | def test_from_attributes_root(): |
no test coverage detected