コード例 #1
0
ファイル: test_utils.py プロジェクト: bmsrangel/Python_CeV
 def test_catch_no_raise(self):
     try:
         raises(self.e)(self.does_not_raise_exception)()  # raises?
     except AssertionError:
         return
     else:
         raise AssertionError("should have raised an AssertionError")
コード例 #2
0
ファイル: test_utils.py プロジェクト: nolta/numpy
 def test_catch_no_raise(self):
     try:
         raises(self.e)(self.does_not_raise_exception)()  # raises?
     except AssertionError:
         return
     else:
         raise AssertionError("should have raised an AssertionError")
コード例 #3
0
ファイル: test_utils.py プロジェクト: bmsrangel/Python_CeV
 def test_wrong_exception(self):
     try:
         raises(self.e)(self.raises_exception)(RuntimeError)  # raises?
     except RuntimeError:
         return
     else:
         raise AssertionError("should have caught RuntimeError")
コード例 #4
0
ファイル: test_utils.py プロジェクト: nolta/numpy
 def test_wrong_exception(self):
     try:
         raises(self.e)(self.raises_exception)(RuntimeError)  # raises?
     except RuntimeError:
         return
     else:
         raise AssertionError("should have caught RuntimeError")
コード例 #5
0
ファイル: test_utils.py プロジェクト: bmsrangel/Python_CeV
 def test_correct_catch(self):
     raises(self.e)(self.raises_exception)(self.e)  # raises?
コード例 #6
0
ファイル: test_format.py プロジェクト: Ombarus/python_env
def test_read_version_1_0_bad_magic():
    for magic in bad_version_magic + malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_array), f
コード例 #7
0
ファイル: test_format.py プロジェクト: Ombarus/python_env
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f
コード例 #8
0
ファイル: test_utils.py プロジェクト: nolta/numpy
 def test_correct_catch(self):
     raises(self.e)(self.raises_exception)(self.e)  # raises?