ensure OutcomeExceptions like skip/fail have initialized exception attributes
This commit is contained in:
parent
51b40dd22c
commit
570688f701
|
@ -19,6 +19,8 @@ Changes between 2.3.4 and 2.3.5dev
|
||||||
- improve PYTEST_DEBUG tracing output by puting
|
- improve PYTEST_DEBUG tracing output by puting
|
||||||
extra data on a new lines with additional indent
|
extra data on a new lines with additional indent
|
||||||
|
|
||||||
|
- ensure OutcomeExceptions like skip/fail have initialized exception attributes
|
||||||
|
|
||||||
Changes between 2.3.3 and 2.3.4
|
Changes between 2.3.3 and 2.3.4
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
|
|
@ -364,6 +364,7 @@ class OutcomeException(Exception):
|
||||||
contain info about test and collection outcomes.
|
contain info about test and collection outcomes.
|
||||||
"""
|
"""
|
||||||
def __init__(self, msg=None, pytrace=True):
|
def __init__(self, msg=None, pytrace=True):
|
||||||
|
super(OutcomeException, self).__init__(msg)
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
self.pytrace = pytrace
|
self.pytrace = pytrace
|
||||||
|
|
||||||
|
|
|
@ -378,6 +378,10 @@ def test_runtest_in_module_ordering(testdir):
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
def test_outcomeexception_exceptionattributes():
|
||||||
|
outcome = runner.OutcomeException('test')
|
||||||
|
assert outcome.message == outcome.msg
|
||||||
|
|
||||||
def test_pytest_exit():
|
def test_pytest_exit():
|
||||||
try:
|
try:
|
||||||
py.test.exit("hello")
|
py.test.exit("hello")
|
||||||
|
|
Loading…
Reference in New Issue