Fold skipped tests with global pytestmark variable
This commit is contained in:
@@ -676,6 +676,7 @@ def test_skip_reasons_folding():
|
||||
ev1.longrepr = longrepr
|
||||
|
||||
ev2 = X()
|
||||
ev2.when = "execute"
|
||||
ev2.longrepr = longrepr
|
||||
ev2.skipped = True
|
||||
|
||||
@@ -713,6 +714,27 @@ def test_skipped_reasons_functional(testdir):
|
||||
assert result.ret == 0
|
||||
|
||||
|
||||
def test_skipped_folding(testdir):
|
||||
testdir.makepyfile(
|
||||
test_one="""
|
||||
import pytest
|
||||
pytestmark = pytest.mark.skip("Folding")
|
||||
def setup_function(func):
|
||||
pass
|
||||
def test_func():
|
||||
pass
|
||||
class TestClass(object):
|
||||
def test_method(self):
|
||||
pass
|
||||
""",
|
||||
)
|
||||
result = testdir.runpytest('-rs')
|
||||
result.stdout.fnmatch_lines([
|
||||
"*SKIP*2*test_one.py: Folding"
|
||||
])
|
||||
assert result.ret == 0
|
||||
|
||||
|
||||
def test_reportchars(testdir):
|
||||
testdir.makepyfile("""
|
||||
import pytest
|
||||
|
||||
Reference in New Issue
Block a user