Skip to content

how to clean up between each test to prevent RuntimeError: Event loop is closed #384

Answered by agronholm
nbraun-wolf asked this question in Q&A
Discussion options

You must be logged in to vote

You need to tie the client creation and shutdown to the application or test life cycle, just like you do with the HTTP client. Creating an async client as an import side effect is not going to work very well.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@nbraun-wolf
Comment options

@agronholm
Comment options

@nbraun-wolf
Comment options

@agronholm
Comment options

@nbraun-wolf
Comment options

Answer selected by nbraun-wolf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants