def given_an_exception_to_throw(self):
        self.x = 0
        self.expected_exception = ValueError()

        @circuitbreaker(ValueError, threshold=3, reset_timeout=1, on_error=self.on_error_callback)
        def function_to_break():
            self.x += 1
            raise self.expected_exception
        self.function_to_break = function_to_break