Testing retry logic, circuit breakers and polling loops with wrapture's phases, where a binding's behaviour changes on a count, a condition, an exhausted sequence, or a signal from elsewhere.

The same unit tests written with unittest.mock and with wrapture, focusing on the cases where wrapping the real code rather than replacing it changes what a test can say.

Testing retry logic, circuit breakers and polling loops with wrapture's phases, where a binding's behaviour changes on a count, a condition, an exhausted sequence, or a signal…