|
1 | | -import sys |
2 | 1 | import pydantic |
3 | 2 | import pytest |
4 | 3 | import typing as ty |
5 | 4 |
|
6 | 5 | from ..conftest import InnerSchema, SampleDataclass |
7 | 6 |
|
8 | 7 | types = pytest.importorskip("django_pydantic_field.v2.types") |
9 | | -skip_unsupported_builtin_subscription = pytest.mark.skipif( |
10 | | - sys.version_info < (3, 9), |
11 | | - reason="Built-in type subscription supports only in 3.9+", |
12 | | -) |
13 | 8 |
|
14 | 9 |
|
15 | 10 | # fmt: off |
16 | 11 | @pytest.mark.parametrize( |
17 | 12 | "ctor, args, kwargs", |
18 | 13 | [ |
19 | | - pytest.param(types.SchemaAdapter, ["list[int]", None, None, None], {}, marks=skip_unsupported_builtin_subscription), |
20 | | - pytest.param(types.SchemaAdapter, ["list[int]", {"strict": True}, None, None], {}, marks=skip_unsupported_builtin_subscription), |
| 14 | + pytest.param(types.SchemaAdapter, ["list[int]", None, None, None], {}), |
| 15 | + pytest.param(types.SchemaAdapter, ["list[int]", {"strict": True}, None, None], {}), |
21 | 16 | (types.SchemaAdapter, [ty.List[int], None, None, None], {}), |
22 | 17 | (types.SchemaAdapter, [ty.List[int], {"strict": True}, None, None], {}), |
23 | 18 | (types.SchemaAdapter, [None, None, InnerSchema, "stub_int"], {}), |
24 | 19 | (types.SchemaAdapter, [None, None, SampleDataclass, "stub_int"], {}), |
25 | | - pytest.param(types.SchemaAdapter.from_type, ["list[int]"], {}, marks=skip_unsupported_builtin_subscription), |
26 | | - pytest.param(types.SchemaAdapter.from_type, ["list[int]", {"strict": True}], {}, marks=skip_unsupported_builtin_subscription), |
| 20 | + pytest.param(types.SchemaAdapter.from_type, ["list[int]"], {}), |
| 21 | + pytest.param(types.SchemaAdapter.from_type, ["list[int]", {"strict": True}], {}), |
27 | 22 | (types.SchemaAdapter.from_type, [ty.List[int]], {}), |
28 | 23 | (types.SchemaAdapter.from_type, [ty.List[int], {"strict": True}], {}), |
29 | 24 | (types.SchemaAdapter.from_annotation, [InnerSchema, "stub_int"], {}), |
|
0 commit comments