Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proper synchronisation to WebSocketTestSession (#2597)
* Add proper synchronisation to WebSocketTestSession `anyio.sleep(0)` is often used as a way to yield to another task. However, depending on event loop implememtation it is not guaranteed to actually do so in a timely manner. This commit alters this behaviour in _asgi_receive by using `anyio.Event`s as a simple synchronisation primitive, dramatically speeding up the session depending on underlying system/implementation. * Fix mypy type errors Jinja 3.1.4 slightly changed the argument types of FileSystemLoader. * Formatting --------- Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
- Loading branch information