@@ -81,7 +81,7 @@ def test_structure_generics_with_cols(t, result, detailed_validation):
8181@pytest .mark .parametrize (
8282 ("t" , "result" ), ((int , (1 , [2 ], {"3" : 3 })), (str , ("1" , ["2" ], {"3" : "3" })))
8383)
84- def test_39_structure_generics_with_cols (t , result ):
84+ def test_39_structure_generics_with_cols (t , result , genconverter : Converter ):
8585 @define
8686 class GenericCols (Generic [T ]):
8787 a : T
@@ -90,21 +90,21 @@ class GenericCols(Generic[T]):
9090
9191 expected = GenericCols (* result )
9292
93- res = Converter () .structure (asdict (expected ), GenericCols [t ])
93+ res = genconverter .structure (asdict (expected ), GenericCols [t ])
9494
9595 assert res == expected
9696
9797
9898@pytest .mark .parametrize (("t" , "result" ), ((int , (1 , [1 , 2 , 3 ])), (int , (1 , None ))))
99- def test_structure_nested_generics_with_cols (t , result ):
99+ def test_structure_nested_generics_with_cols (t , result , genconverter : Converter ):
100100 @define
101101 class GenericCols (Generic [T ]):
102102 a : T
103103 b : Optional [List [T ]]
104104
105105 expected = GenericCols (* result )
106106
107- res = Converter () .structure (asdict (expected ), GenericCols [t ])
107+ res = genconverter .structure (asdict (expected ), GenericCols [t ])
108108
109109 assert res == expected
110110
@@ -296,6 +296,7 @@ def test_generate_typeddict_mapping() -> None:
296296 from typing import Generic , TypedDict , TypeVar
297297
298298 T = TypeVar ("T" )
299+ U = TypeVar ("U" )
299300
300301 class A (TypedDict ):
301302 pass
@@ -312,6 +313,12 @@ class B(A[int]):
312313
313314 assert generate_mapping (B , {}) == {T .__name__ : int }
314315
316+ class C (Generic [T , U ]):
317+ a : T
318+ c : U
319+
320+ assert generate_mapping (C [int , U ], {}) == {T .__name__ : int }
321+
315322
316323def test_nongeneric_protocols (converter ):
317324 """Non-generic protocols work."""
0 commit comments