diff --git a/tests/test_field_sa_column.py b/tests/test_field_sa_column.py index 51cfdfa..7384f1f 100644 --- a/tests/test_field_sa_column.py +++ b/tests/test_field_sa_column.py @@ -39,6 +39,17 @@ def test_sa_column_no_sa_kargs() -> None: ) +def test_sa_column_no_type() -> None: + with pytest.raises(RuntimeError): + + class Item(SQLModel, table=True): + id: Optional[int] = Field( + default=None, + sa_type=Integer, + sa_column=Column(Integer, primary_key=True), + ) + + def test_sa_column_no_primary_key() -> None: with pytest.raises(RuntimeError):