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):
274274 testdir .makepyfile (
275275 test_a = """
276276 import pytest
277+
277278 def test_a1(): pass
279+
278280 @pytest.mark.parametrize('b', range(3))
279281 def test_a2(b): pass
282+
283+ class TestClass:
284+ def test_c1(self): pass
285+
286+ def test_c2(self): pass
280287 """
281288 )
282289 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" ,
284294 )
285295 assert result .ret == 0
286- result .stdout .fnmatch_lines (["*2 passed, 2 deselected*" ])
296+ result .stdout .fnmatch_lines (["*3 passed, 3 deselected*" ])
287297 for line in result .stdout .lines :
288298 assert not line .startswith (("test_a.py::test_a2[1]" , "test_a.py::test_a2[2]" ))
289299
You can’t perform that action at this time.
0 commit comments