def test_add_does_not_swallow_exceptions(self): original_add = self.cache.graph.add self.cache.graph.add = always_throw(IOError) try: with self.assertRaises(IOError): self.test_populate() finally: self.cache.graph.add = original_add
def test_makedirs_does_not_swallow_exception(self): original_makedirs = os.makedirs os.makedirs = always_throw(OSError) with self.assertRaises(OSError): makedirs('/some/path') os.makedirs = original_makedirs