Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with async api tests #11

Open
robcxyz opened this issue Feb 28, 2023 · 0 comments
Open

Error with async api tests #11

robcxyz opened this issue Feb 28, 2023 · 0 comments

Comments

@robcxyz
Copy link
Contributor

robcxyz commented Feb 28, 2023

Testing api endpoints was throwing errors in CI and when run in make test.

Error:

There is no current event loop in thread 'MainThread' 

Issue mentioned in docs -> https://fastapi.tiangolo.com/advanced/async-tests/

Solved by putting in the @pytest.mark.anyio decorator but this can't be done along with the @pytest.mark.order(-1) decorator that I wanted to use for the APIs to test responses as they come out of the DB once the cron tests have been run.

Making issue to track as would be good to track these tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant