(extra: Literal['ignore', 'forbid', 'allow'])
| 218 | |
| 219 | @pytest.mark.parametrize('extra', ['ignore', 'forbid', 'allow']) |
| 220 | def test_extra_allow_from_orm(extra: Literal['ignore', 'forbid', 'allow']): |
| 221 | class TestCls: |
| 222 | x = 1 |
| 223 | y = 2 |
| 224 | |
| 225 | class Model(BaseModel): |
| 226 | model_config = ConfigDict(from_attributes=True, extra=extra) |
| 227 | x: int |
| 228 | |
| 229 | model = deprecated_from_orm(Model, TestCls()) |
| 230 | assert model.x == 1 |
| 231 | assert not hasattr(model, 'y') |
| 232 | |
| 233 | |
| 234 | @pytest.mark.filterwarnings('ignore:Pydantic V1 style `@root_validator` validators are deprecated.*:DeprecationWarning') |
nothing calls this directly
no test coverage detected