Grokking Concurrency in Python
0% completed
Testing Async Code
Can a test pass when the function it checks never runs? Two tests of Harvest's async fetch function did exactly that. Both ask fetch for a page from port 9 on the local machine, where nothing listens, so a real call would fail at once. The run still ended with Ran 2 tests in 0.021s and OK, because neither test ever ran fetch.
Two Tests That Pass Without Running
Calling an async def function does not run its body
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%