@@ -179,3 +179,45 @@ def test_op_infos(collect_tests, file, cmds, selection):
179
179
def test_nested_names (collect_tests , file , cmds , selection ):
180
180
collection = collect_tests (file , cmds )
181
181
assert collection == selection
182
+
183
+
184
+ @make_parametrization (
185
+ Config (
186
+ selection = (
187
+ "::TestFooCPU::test_bar_cpu" ,
188
+ "::TestSpam::test_ham" ,
189
+ ),
190
+ ),
191
+ Config (
192
+ new_cmds = "::TestFoo" ,
193
+ selection = (),
194
+ ),
195
+ Config (
196
+ new_cmds = "::TestFoo::test_bar" ,
197
+ selection = (),
198
+ ),
199
+ Config (
200
+ new_cmds = "::TestFooCPU" ,
201
+ legacy_cmds = ("-k" , "TestFoo" ),
202
+ selection = ("::TestFooCPU::test_bar_cpu" ,),
203
+ ),
204
+ Config (
205
+ new_cmds = "::TestFooCPU::test_bar_cpu" ,
206
+ legacy_cmds = ("-k" , "TestFoo and test_bar" ),
207
+ selection = ("::TestFooCPU::test_bar_cpu" ,),
208
+ ),
209
+ Config (
210
+ new_cmds = "::TestSpam" ,
211
+ legacy_cmds = ("-k" , "TestSpam" ),
212
+ selection = ("::TestSpam::test_ham" ,),
213
+ ),
214
+ Config (
215
+ new_cmds = "::TestSpam::test_ham" ,
216
+ legacy_cmds = ("-k" , "TestSpam and test_ham" ),
217
+ selection = ("::TestSpam::test_ham" ,),
218
+ ),
219
+ file = "test_disabled.py" ,
220
+ )
221
+ def test_disabled (collect_tests , file , cmds , selection ):
222
+ collection = collect_tests (file , ("--disable-pytest-pytorch" , * cmds ))
223
+ assert collection == selection
0 commit comments