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

RuntimeError raised when running some tests on their own #894

Open
Askaholic opened this issue Mar 14, 2022 · 0 comments
Open

RuntimeError raised when running some tests on their own #894

Askaholic opened this issue Mar 14, 2022 · 0 comments

Comments

@Askaholic
Copy link
Collaborator

Askaholic commented Mar 14, 2022

There are some tests that construct objects which try to access the current event loop in their constructors (such as Search and Game). If these tests are not declared to be async then when they are run in isolation they will raise this error:

RuntimeError: There is no current event loop in thread 'MainThread'.

However, they work when running the test suite as a whole because they will get the event loop created by previous tests. Either the tests should be converted to async functions, or the classes causing the problem need to be refactored so that they can be constructed without an event loop existing.

Currently at least these tests have the problem:

  • Everything in tests/unit_tests/test_matchmaker_algorithm_bucket_teams.py

The error can be reproduced by running tests like this pipenv run tests tests/unit_tests/test_matchmaker_algorithm_bucket_teams.py::test_make_teams_single_correct_size

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