我有要测试的代码:
from random import randint
class End(object):
def __init__(self):
self.quips=['You dead', 'You broke everything you can','You turn you head off']
def play(self):
print self.quips[randint(0, len(self.quips)-1)]
sys.exit(1)
如何使用 accept_raises 检查它是否退出?
def test_End():
end=End().play()
assert_raises(what should I put here)