Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 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")
Ejemplo n.º 5
0
 def test_correct_catch(self):
     raises(self.e)(self.raises_exception)(self.e)  # raises?
Ejemplo n.º 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
Ejemplo n.º 7
0
def test_read_magic_bad_magic():
    for magic in malformed_magic:
        f = BytesIO(magic)
        yield raises(ValueError)(format.read_magic), f
Ejemplo n.º 8
0
 def test_correct_catch(self):
     raises(self.e)(self.raises_exception)(self.e)  # raises?