Skip to content

Commit f404ecd

Browse files
author
Natarajan Krishnaswami
committed
Remove zero-arg generic dict test
1 parent 26bda61 commit f404ecd

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

tests/test_attribute_keyed_dict.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from sqlalchemy.orm.collections import attribute_keyed_dict
77
from sqlmodel import Field, Relationship, Session, SQLModel, create_engine
88

9-
from tests.conftest import needs_pydanticv2
9+
from tests.conftest import needs_py39, needs_pydanticv2
1010

1111

1212
def test_attribute_keyed_dict_works(clear_sqlmodel):
@@ -66,19 +66,6 @@ class Child(SQLModel, table=True):
6666

6767
error_msg_fmt = "Dict/Mapping relationship field 'children_by_color' has {count} type arguments. Exactly two required (e.g., dict[str, Model])"
6868

69-
# No type args
70-
with pytest.raises(ValueError, match=re.escape(error_msg_fmt.format(count=0))):
71-
72-
class Parent(SQLModel, table=True):
73-
__tablename__ = "parents"
74-
75-
id: Optional[int] = Field(primary_key=True, default=None)
76-
children_by_color: dict[()] = Relationship(
77-
sa_relationship_kwargs={
78-
"collection_class": attribute_keyed_dict("color")
79-
}
80-
)
81-
8269
# One type arg
8370
with pytest.raises(ValueError, match=re.escape(error_msg_fmt.format(count=1))):
8471

0 commit comments

Comments
 (0)