예제 #1
0
파일: __init__.py 프로젝트: jimmydo/grain
 def test_fails_when_no_exception_is_raised(self):
     with assert_raises_assertion(
             "Expected code to raise <class 'tests.ExpectedError'>"):
         with expect.raises(ExpectedError):
             pass
예제 #2
0
파일: __init__.py 프로젝트: jimmydo/grain
 def test_allows_unexpected_exception_to_bubble_up(self):
     with assert_raises(ActualError, 'Unexpected exception should bubble up'):
         with expect.raises(ExpectedError):
             raise ActualError('Unexpected exception should bubble up')
예제 #3
0
파일: __init__.py 프로젝트: jimmydo/grain
 def test_passes_for_expected_exception(self):
     with expect.raises(ExpectedError):
         raise ExpectedError