Skip to content

Commit de70227

Browse files
🎨 Update test cases
Co-authored-by: Motov Yurii <[email protected]>
1 parent 8314d1d commit de70227

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

tests/test_field_pd_and_json_kwarrgs.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,11 @@ def test_schema_extra_and_new_param_conflict():
4040
"""test that passing schema_extra and new params at the same time raises an error"""
4141

4242
with pytest.raises(RuntimeError) as excinfo:
43-
44-
class ItemA(SQLModel):
45-
name: str = Field(
46-
schema_extra={"legacy": 1},
47-
json_schema_extra={"new": 2},
48-
)
49-
43+
Field(schema_extra={"legacy": 1}, json_schema_extra={"new": 2})
5044
assert "Passing schema_extra is not supported" in str(excinfo.value)
5145

5246
with pytest.raises(RuntimeError) as excinfo:
53-
54-
class ItemB(SQLModel):
55-
name: str = Field(
56-
schema_extra={"legacy": 1},
57-
pydantic_kwargs={"alias": "Alias"},
58-
)
59-
47+
Field(schema_extra={"legacy": 1}, pydantic_kwargs={"alias": "Alias"})
6048
assert "Passing schema_extra is not supported" in str(excinfo.value)
6149

6250

0 commit comments

Comments
 (0)