Fold skipped tests with global pytestmark variable

This commit is contained in:
prokaktus
2017-08-12 16:50:54 +03:00
parent 9e62a31b63
commit 98bf5fc9be
4 changed files with 38 additions and 3 deletions

View File

@@ -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