Closed errietta closed 5 years ago
Forgot to say, was just wondering if there's a better way that you know of
Sorry, I haven't done any work with asynctest and kgb. No idea what the best approach would be. I'm certainly open to improvements in this area. It's just not something we've had an immediate need for in our work.
Not necessarily an issue, but I was wondering if you've tried playing with this and asynctest (or any other ways of testing async code?). This is the way that I found that seemed to work:
Basically create CoroutineMock,
call_fake
with it, then use the asynctest.TestCase API. So only use kgb to do the spying. Seems like a bit of a nasty hack, but the core patching API (so also this API) is harder to use/more inflexible, which is why I wanted to use kgb to begin with 😂