make Test Outcomes inherit from BaseException instead of exception

fixes #580
This commit is contained in:
Ronny Pfannschmidt
2015-09-19 01:03:05 +02:00
parent 17121960b4
commit 06a49338b2
13 changed files with 176 additions and 156 deletions

View File

@@ -6,7 +6,7 @@ import os
import py
import pytest
import sys
from _pytest import runner, main
from _pytest import runner, main, outcomes
class TestSetupState(object):
@@ -449,10 +449,19 @@ def test_runtest_in_module_ordering(testdir):
def test_outcomeexception_exceptionattributes():
outcome = runner.OutcomeException('test')
outcome = outcomes.OutcomeException('test')
assert outcome.args[0] == outcome.msg
def test_outcomeexception_passes_except_Exception():
with pytest.raises(outcomes.OutcomeException):
try:
raise outcomes.OutcomeException('test')
except Exception:
pass
def test_pytest_exit():
try:
pytest.exit("hello")