def test_error(self): with temp_filename() as filename: with open(filename, "wb") as h: h.write(b"something") faulthandling.enable(filename) with self.assertRaises(FaultHandlerCrash): faulthandling.raise_and_clear_error() faulthandling.disable()
def test_basic(self): with temp_filename() as filename: faulthandling.enable(filename) faulthandling.raise_and_clear_error() faulthandling.disable()