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
tests/unit_tests: fix tests broken by fastapi upgrade
The `fastapi` version upgrade affected unit tests
as `TestClient` has been upgraded to use `httpx`.
Reference to the release note:
https://fastapi.tiangolo.com/release-notes/#0870
This introduced the below failure in the API unit
tests:
```
> raise RuntimeError('Event loop is closed')
E RuntimeError: Event loop is closed
/usr/local/lib/python3.11/asyncio/base_events.py:520: RuntimeError
```
Based on the observation, it seems like somehow
`TestClient` is closing event loop after executing the
first test.
It is backed by the GH issue:
encode/starlette#2069
Fix the issue by using the same test client for all the
synchronous tests.
Fixture `event_loop` is not required anymore after changing
`TestClient` scope to `session`. Hence, drop it.
Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
0 commit comments