Allow then_do
to take an async
function if the mock is async
#136
Labels
enhancement
New feature or request
then_do
to take an async
function if the mock is async
#136
The
then_do
method is a useful advanced method for some tests, especially when you're not in a position to change the API of a dependency at the time you're writing the test.However, the
then_do
method only accepts a synchronous callable, even if the mock is an asynchronous mock. I've run into a few cases where this limitation was frustrating and I didn't have an immediately obvious path for better code structure within the constraints I needed to follow.then_do
side-effectasync
function to a sync mock should raise an exceptionThe text was updated successfully, but these errors were encountered: