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