Skip to content
Snippets Groups Projects
Commit 9078d279 authored by David Douard's avatar David Douard
Browse files

tests: make test_statsd more robust when executed along other asyncio-based tests

use a newly created event loop to consume events in test_timed_coroutine.
ome reason, executing this later test in the same test session as
swh/core/api/tests/test_async.py fail because the main event loop seems
to be closed by the test.
parent b5a48c4f
No related branches found
No related tags found
1 merge request!64api/async: fix json decoder and add a few tests for the asynchronous api code
# Copyright (C) 2018 The Software Heritage developers
# Copyright (C) 2018-2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
......@@ -312,7 +312,7 @@ class TestStatsd(unittest.TestCase):
time.sleep(0.5)
print("foo")
loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
loop.run_until_complete(print_foo())
loop.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment