You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/errors-and-warnings.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,24 @@ decoy.when().then_return(42) # raises a MissingRehearsalError
27
27
If you're working with async/await code, this can also happen if you forget to include `await` in your rehearsal, because the `await` is necessary for the spy's call handler to add the call to the stack.
28
28
29
29
```python
30
-
decoy.when(some_async_func("hello")).then_return("world") # will raise
31
30
decoy.when(await some_async_func("hello")).then_return("world") # all good
31
+
decoy.when(some_async_func("hello")).then_return("world") # will raise
32
+
```
33
+
34
+
### MockNotAsyncError
35
+
36
+
A [decoy.errors.MockNotAsyncError][] will be raised if you pass an `async def` function to [decoy.Stub.then_do][] of a non-synchronous mock.
0 commit comments