File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,9 @@ def test_union():
76
76
assert field .type .of_type .__name__ .startswith ("UnionOf" )
77
77
78
78
79
- if sys .version_info >= (3 , 8 ):
80
- # Python < 3.8 does not support typing.Literal
79
+ if sys .version_info >= (3 , 10 ):
80
+ # Python < 3.10 does not support typing.Literal except as a
81
+ # _SpecialGenericAlias, which Pydantic doesn't like
81
82
82
83
def test_literal ():
83
84
field = _convert_field_from_spec (
@@ -87,11 +88,6 @@ def test_literal():
87
88
assert field .default_value == 3
88
89
assert field .type .of_type .__name__ .startswith ("UnionOf" )
89
90
90
-
91
- if sys .version_info >= (3 , 10 ):
92
- # Python < 3.10 does not support typing.Literal except as a
93
- # _SpecialGenericAlias, which Pydantic doesn't like
94
-
95
91
def test_literal_singleton ():
96
92
field = _convert_field_from_spec ("attr" , (T .Literal ["literal1" ], "literal1" ))
97
93
assert issubclass (field .type .of_type , graphene .String )
You can’t perform that action at this time.
0 commit comments