Skip to content
12 changes: 1 addition & 11 deletions tests/test_pydantic/test_field.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from decimal import Decimal
from typing import List, Optional, Union
from typing import Optional, Union

import pytest
from pydantic import ValidationError
Expand All @@ -22,16 +22,6 @@ class Model(SQLModel):
Model(dec=Decimal("420"))


def test_unique_items():
class Model(SQLModel):
unique_strings: List[str] = Field(unique_items=True)

Model(unique_strings=["x", "y"])

with pytest.raises(ValidationError):
Model(unique_strings=["x", "y", "x"])


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove and not skipif, as pydantic v2 support is not present now?

Please note that if that means Pydantic v2 support in few days, I'm fine with it ;-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the plan is to support SQLAlchemy 2.0 and Pydantic 2.0 as soon as possible. 🤓

def test_discriminator():
# Example adapted from
# [Pydantic docs](https://pydantic-docs.helpmanual.io/usage/types/#discriminated-unions-aka-tagged-unions):
Expand Down