File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -274,16 +274,26 @@ def test_deselect(testdir):
274
274
testdir .makepyfile (
275
275
test_a = """
276
276
import pytest
277
+
277
278
def test_a1(): pass
279
+
278
280
@pytest.mark.parametrize('b', range(3))
279
281
def test_a2(b): pass
282
+
283
+ class TestClass:
284
+ def test_c1(self): pass
285
+
286
+ def test_c2(self): pass
280
287
"""
281
288
)
282
289
result = testdir .runpytest (
283
- "-v" , "--deselect=test_a.py::test_a2[1]" , "--deselect=test_a.py::test_a2[2]"
290
+ "-v" ,
291
+ "--deselect=test_a.py::test_a2[1]" ,
292
+ "--deselect=test_a.py::test_a2[2]" ,
293
+ "--deselect=test_a.py::TestClass::test_c1" ,
284
294
)
285
295
assert result .ret == 0
286
- result .stdout .fnmatch_lines (["*2 passed, 2 deselected*" ])
296
+ result .stdout .fnmatch_lines (["*3 passed, 3 deselected*" ])
287
297
for line in result .stdout .lines :
288
298
assert not line .startswith (("test_a.py::test_a2[1]" , "test_a.py::test_a2[2]" ))
289
299
You can’t perform that action at this time.
0 commit comments