3030U = TypeVar ("U" )
3131
3232
33- def test_types ():
33+ def test_types () -> None :
3434 assert is_list (List [int ])
3535 assert is_list (List )
3636 assert is_set (Set [int ])
@@ -68,7 +68,7 @@ def test_types():
6868 assert is_opt (str | None )
6969
7070
71- def test_typename ():
71+ def test_typename () -> None :
7272 @serde .serde
7373 class Bar (Generic [T ]):
7474 v : T
@@ -87,13 +87,13 @@ class Foo(Generic[T]):
8787 assert typename (Tuple [int , str ]) == "Tuple[int, str]"
8888 assert typename (Tuple [int , ...]) == "Tuple[int, ...]"
8989 assert typename (Dict ) == "Dict"
90- assert typename (Dict [str , Foo ]) == "Dict[str, Foo]"
90+ assert typename (Dict [str , Foo ]) == "Dict[str, Foo]" # type: ignore
9191 assert typename (Set ) == "Set"
9292 assert typename (Set [int ]) == "Set[int]"
93- assert typename (Literal [1 , 1.0 , "Hey" ]) == "Literal[1, 1.0 , Hey]"
93+ assert typename (Literal [1 , True , "Hey" ]) == "Literal[1, True , Hey]"
9494
9595
96- def test_iter_types ():
96+ def test_iter_types () -> None :
9797 assert {Pri , int , str , float , bool } == set (iter_types (Pri ))
9898 assert {Dict , str , Pri , int , float , bool } == set (iter_types (Dict [str , Pri ]))
9999 assert {List , str } == set (iter_types (List [str ]))
@@ -115,7 +115,7 @@ class Foo:
115115 assert {Foo , datetime , Optional , str , Union , List , Set , int } == set (iter_types (Foo ))
116116
117117
118- def test_iter_unions ():
118+ def test_iter_unions () -> None :
119119 assert [Union [str , int ]] == list (iter_unions (Union [str , int ]))
120120 assert [Union [str , int ]] == list (iter_unions (Dict [str , Union [str , int ]]))
121121 assert [Union [str , int ]] == list (iter_unions (Tuple [Union [str , int ]]))
@@ -134,7 +134,7 @@ class A:
134134 )
135135
136136
137- def test_type_args ():
137+ def test_type_args () -> None :
138138 assert (int ,) == type_args (List [int ])
139139 assert (int , str ) == type_args (Dict [int , str ])
140140 assert (int , type (None )) == type_args (Optional [int ])
@@ -151,13 +151,13 @@ def test_type_args():
151151 assert (int , Ellipsis ) == type_args (tuple [int , ...])
152152
153153
154- def test_union_args ():
154+ def test_union_args () -> None :
155155 assert (int , str ) == union_args (Union [int , str ])
156156 assert (List [int ], Dict [int , str ]) == union_args (Union [List [int ], Dict [int , str ]])
157157 assert (Optional [int ], str ) == union_args (Union [Optional [int ], str ])
158158
159159
160- def test_is_instance ():
160+ def test_is_instance () -> None :
161161 # Primitive
162162 assert is_instance (10 , int )
163163 assert is_instance ("str" , str )
@@ -257,7 +257,7 @@ class GenericFoo(Generic[T]):
257257 t : T
258258
259259
260- def test_is_generic ():
260+ def test_is_generic () -> None :
261261 assert not is_generic (int )
262262 assert not is_generic (List [int ])
263263 assert not is_generic (List )
@@ -272,7 +272,7 @@ def test_is_generic():
272272 assert not serde .is_deserializable (GenericFoo [List [int ]])
273273
274274
275- def test_get_generic_arg ():
275+ def test_get_generic_arg () -> None :
276276 class GenericFoo (Generic [T , U ]):
277277 pass
278278
0 commit comments