parent
9d4e0365da
commit
f90b2f845c
|
@ -13,6 +13,9 @@
|
||||||
- fix issue114: skipif marker reports to internal skipping plugin;
|
- fix issue114: skipif marker reports to internal skipping plugin;
|
||||||
Thanks Floris Bruynooghe for reporting and Bruno Oliveira for the PR.
|
Thanks Floris Bruynooghe for reporting and Bruno Oliveira for the PR.
|
||||||
|
|
||||||
|
- fix issue748: unittest.SkipTest reports to internal pytest unittest plugin.
|
||||||
|
Thanks Thomas De Schampheleire for reporting and Bruno Oliveira for the PR.
|
||||||
|
|
||||||
2.7.1 (compared to 2.7.0)
|
2.7.1 (compared to 2.7.0)
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import py
|
||||||
|
|
||||||
# for transfering markers
|
# for transfering markers
|
||||||
from _pytest.python import transfer_markers
|
from _pytest.python import transfer_markers
|
||||||
|
from _pytest.skipping import MarkEvaluator
|
||||||
|
|
||||||
|
|
||||||
def pytest_pycollect_makeitem(collector, name, obj):
|
def pytest_pycollect_makeitem(collector, name, obj):
|
||||||
|
@ -113,6 +114,8 @@ class TestCaseFunction(pytest.Function):
|
||||||
try:
|
try:
|
||||||
pytest.skip(reason)
|
pytest.skip(reason)
|
||||||
except pytest.skip.Exception:
|
except pytest.skip.Exception:
|
||||||
|
self._evalskip = MarkEvaluator(self, 'SkipTest')
|
||||||
|
self._evalskip.result = True
|
||||||
self._addexcinfo(sys.exc_info())
|
self._addexcinfo(sys.exc_info())
|
||||||
|
|
||||||
def addExpectedFailure(self, testcase, rawexcinfo, reason=""):
|
def addExpectedFailure(self, testcase, rawexcinfo, reason=""):
|
||||||
|
|
|
@ -700,4 +700,17 @@ def test_issue333_result_clearing(testdir):
|
||||||
reprec = testdir.inline_run()
|
reprec = testdir.inline_run()
|
||||||
reprec.assertoutcome(failed=1)
|
reprec.assertoutcome(failed=1)
|
||||||
|
|
||||||
|
@pytest.mark.skipif("sys.version_info < (2,7)")
|
||||||
|
def test_unittest_raise_skip_issue748(testdir):
|
||||||
|
testdir.makepyfile(test_foo="""
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class MyTestCase(unittest.TestCase):
|
||||||
|
def test_one(self):
|
||||||
|
raise unittest.SkipTest('skipping due to reasons')
|
||||||
|
""")
|
||||||
|
result = testdir.runpytest("-v", '-rs')
|
||||||
|
result.stdout.fnmatch_lines("""
|
||||||
|
*SKIP*[1]*test_foo.py*skipping due to reasons*
|
||||||
|
*1 skipped*
|
||||||
|
""")
|
||||||
|
|
Loading…
Reference in New Issue