First argument in pytest.mark.skip is a reason

This commit is contained in:
Michael Aquilina
2015-10-01 22:35:38 +01:00
parent 1b5aa2868d
commit 9e57954b03
2 changed files with 30 additions and 8 deletions

View File

@@ -409,6 +409,19 @@ class TestSkip(object):
rec = testdir.inline_run()
rec.assertoutcome(skipped=1)
def test_arg_as_reason(self, testdir):
testdir.makepyfile("""
import pytest
@pytest.mark.skip('testing stuff')
def test_bar():
pass
""")
result = testdir.runpytest('-rs')
result.stdout.fnmatch_lines([
"*testing stuff*",
"*1 skipped*",
])
def test_skip_no_reason(self, testdir):
testdir.makepyfile("""
import pytest