Skip to content

Commit

Permalink
♻️ Import from typing_extensions to support Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Oct 26, 2023
1 parent 5ff6d2a commit 470e813
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions tests/test_pydantic/test_field.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
"""
Tests to ensure that the SQLModel `Field` constructor works as
expected from the Pydantic `Field` function.
"""
import sys
from decimal import Decimal
from typing import List, Optional, Union

import pytest
from pydantic import ValidationError
from sqlmodel import Field, SQLModel
from typing_extensions import Literal


def test_decimal():
Expand Down Expand Up @@ -36,12 +32,7 @@ class Model(SQLModel):
Model(unique_strings=["x", "y", "x"])


@pytest.mark.skipif(
sys.version_info < (3, 8), reason="requires Python 3.8+ (for `typing.Literal`)"
)
def test_discriminator():
from typing import Literal

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

Expand Down

0 comments on commit 470e813

Please sign in to comment.