@@ -50,19 +50,19 @@ class MyTypedDict(typing.TypedDict):
5050 (typing .List [int ], "List[int]" ),
5151 (typing .Tuple [str , int ], "Tuple[str, int]" ),
5252 (typing .Optional [int ], "Optional[int]" ),
53- (MyClass , "tests .MyClass" ),
54- (OuterClass .InnerClass , "tests .OuterClass.InnerClass" ),
55- (typing .List [MyClass ], "List[tests .MyClass]" ),
56- (typing .Optional [typing .List [MyClass ]], "Optional[List[tests .MyClass]]" ),
53+ (MyClass , "test_typenames .MyClass" ),
54+ (OuterClass .InnerClass , "test_typenames .OuterClass.InnerClass" ),
55+ (typing .List [MyClass ], "List[test_typenames .MyClass]" ),
56+ (typing .Optional [typing .List [MyClass ]], "Optional[List[test_typenames .MyClass]]" ),
5757 (typing .Union [float , int ], "Union[float, int]" ),
5858 (typing .Dict [str , int ], "Dict[str, int]" ),
5959 (typing .Any , "Any" ),
6060 (typing .Dict [str , typing .Any ], "Dict[str, Any]" ),
6161 (typing .Callable [..., str ], "Callable[..., str]" ),
6262 (typing .Callable [[int ], str ], "Callable[[int], str]" ),
6363 (typing .Callable [[int , float ], str ], "Callable[[int, float], str]" ),
64- (MyGeneric [int ], "tests .MyGeneric[int]" ),
65- (MyEnum , "tests .MyEnum" ),
64+ (MyGeneric [int ], "test_typenames .MyGeneric[int]" ),
65+ (MyEnum , "test_typenames .MyEnum" ),
6666 (typing .List ["int" ], "List[int]" ),
6767 (typing .List ["typing.Any" ], "List[Any]" ),
6868 (typing .List ["enum.Enum" ], "List[enum.Enum]" ),
@@ -71,7 +71,7 @@ class MyTypedDict(typing.TypedDict):
7171 # Python 3.8 adds typing.Literal, typing.Final, typing.TypedDict
7272 (typing .Literal ["s" , 0 , MyEnum .MEMBER1 ], "Literal['s', 0, MyEnum.MEMBER1]" ),
7373 (typing .Final [int ], "Final[int]" ),
74- (MyTypedDict , "tests .MyTypedDict" ),
74+ (MyTypedDict , "test_typenames .MyTypedDict" ),
7575]
7676
7777
@@ -130,19 +130,19 @@ class FnScopeClass: ...
130130
131131 # Default removal
132132 assert typenames (typing .Any ) == "Any"
133- assert typenames (MyClass ) == "tests .MyClass"
133+ assert typenames (MyClass ) == "test_typenames .MyClass"
134134 assert typenames (OtherModuleClass ) == "other_module.OtherModuleClass"
135- assert typenames (FnScopeClass ) == "tests .test_remove_modules.<locals>.FnScopeClass"
135+ assert typenames (FnScopeClass ) == "test_typenames .test_remove_modules.<locals>.FnScopeClass"
136136
137137 # Override
138- config = TypenamesConfig (remove_modules = ["tests " ])
138+ config = TypenamesConfig (remove_modules = ["test_typenames " ])
139139 assert typenames (typing .Any , config = config ) == "typing.Any"
140140 assert typenames (MyClass , config = config ) == "MyClass"
141141 assert typenames (OtherModuleClass , config = config ) == "other_module.OtherModuleClass"
142142 assert typenames (FnScopeClass , config = config ) == "test_remove_modules.<locals>.FnScopeClass"
143143
144144 # Add to defaults
145- config = TypenamesConfig (remove_modules = DEFAULT_REMOVE_MODULES + ["tests " ])
145+ config = TypenamesConfig (remove_modules = DEFAULT_REMOVE_MODULES + ["test_typenames " ])
146146 assert typenames (typing .Any , config = config ) == "Any"
147147 assert typenames (MyClass , config = config ) == "MyClass"
148148 assert typenames (OtherModuleClass , config = config ) == "other_module.OtherModuleClass"
@@ -278,15 +278,19 @@ def test_node_repr():
278278
279279
280280@pytest .mark .parametrize (
281- "case" , is_union_special_form_cases , ids = [str (c [0 ]) for c in is_union_special_form_cases ]
281+ "case" ,
282+ is_union_special_form_cases ,
283+ ids = [str (c [0 ]) for c in is_union_special_form_cases ],
282284)
283285def test_is_union_special_form (case ):
284286 """Test that is_union_special_form correctly identifies if using typing.Union."""
285287 assert is_union_special_form (case [0 ]) == case [1 ]
286288
287289
288290@pytest .mark .parametrize (
289- "case" , is_union_special_form_cases , ids = [str (c [0 ]) for c in is_union_special_form_cases ]
291+ "case" ,
292+ is_union_special_form_cases ,
293+ ids = [str (c [0 ]) for c in is_union_special_form_cases ],
290294)
291295def test_is_union_or_operator_for_typing_alias_cases (case ):
292296 """Test that is_union_or_operator correctly returns False for all typing.Union test cases."""
@@ -305,14 +309,18 @@ def test_is_union_or_operator_for_typing_alias_cases(case):
305309 ]
306310
307311 @pytest .mark .parametrize (
308- "case" , is_union_or_operator_cases , ids = [str (c [0 ]) for c in is_union_or_operator_cases ]
312+ "case" ,
313+ is_union_or_operator_cases ,
314+ ids = [str (c [0 ]) for c in is_union_or_operator_cases ],
309315 )
310316 def test_is_union_or_operator (case ):
311317 """Test that is_union_or_operator correctly identifies cases using | operator."""
312318 assert is_union_or_operator (case [0 ]) == case [1 ]
313319
314320 @pytest .mark .parametrize (
315- "case" , is_union_or_operator_cases , ids = [str (c [0 ]) for c in is_union_or_operator_cases ]
321+ "case" ,
322+ is_union_or_operator_cases ,
323+ ids = [str (c [0 ]) for c in is_union_or_operator_cases ],
316324 )
317325 def test_is_union_special_form_for_or_operator_cases (case ):
318326 """Test that is_union_special_form correctly returns False for all | operator cases."""
0 commit comments