We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b00d2ff commit a6a315eCopy full SHA for a6a315e
tests/conftest.py
@@ -7,6 +7,21 @@
7
from aiorethink.registry import registry
8
9
10
+# WORKAROUND for https://github.com/pytest-dev/pytest-asyncio/issues/30
11
+@pytest.yield_fixture
12
+def event_loop():
13
+ """Create an instance of the default event loop for each test case."""
14
+ policy = asyncio.get_event_loop_policy()
15
+ res = policy.new_event_loop()
16
+ asyncio.set_event_loop(res)
17
+ res._close = res.close
18
+ res.close = lambda: None
19
+
20
+ yield res
21
22
+ res._close()
23
24
25
@pytest.fixture(scope = "session")
26
def _db_config():
27
# configure DB exactly once
0 commit comments