derive Exit from KeyboardInterrupt to simplify exception catching

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-05-22 13:01:48 +02:00
parent 4bc352cc7d
commit 30e04b1ec6
3 changed files with 14 additions and 7 deletions

View File

@@ -76,6 +76,13 @@ def test_importorskip():
print py.code.ExceptionInfo()
py.test.fail("spurious skip")
def test_pytest_exit():
try:
py.test.exit("hello")
except:
excinfo = py.code.ExceptionInfo()
assert excinfo.errisinstance(KeyboardInterrupt)
def test_pytest_mark_getattr():
from py.__.test.outcome import mark
def f(): pass