@raises(TestException)
def test_abort_with_exception():
 with settings(abort_exception=TestException):
  abort('Test')

@ raises ( TestException ) def test_abort_with_exception ( ) : with settings ( abort_exception = TestException ) : abort ( 'Test' )
abort() should raise a provided exception .