Exemple #1
0
 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")
Exemple #2
0
 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")
Exemple #3
0
 def test_wrong_exception(self):
     try:
         raises(self.e)(self.raises_exception)(RuntimeError)  # raises?
     except RuntimeError:
         return
     else:
         raise AssertionError("should have caught RuntimeError")
Exemple #4
0
 def test_wrong_exception(self):
     try:
         raises(self.e)(self.raises_exception)(RuntimeError)  # raises?
     except RuntimeError:
         return
     else:
         raise AssertionError("should have caught RuntimeError")
Exemple #5
0
 def test_correct_catch(self):
     raises(self.e)(self.raises_exception)(self.e)  # raises?
Exemple #6
0
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
Exemple #7
0
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f
Exemple #8
0
 def test_correct_catch(self):
     raises(self.e)(self.raises_exception)(self.e)  # raises?