Skip to content

Commit

Permalink
Adjusted Hypothesis integration test to use the same event loop initi…
Browse files Browse the repository at this point in the history
…alization as in the plugin.

The plugin code creates a new event loop from the current event loop policy, whereas the fixture in the Hypothesis test uses get_event_loop. In Python 3.10 the use of get_event_loop was deprecated and causes the Hypothesis tests to fail.

Signed-off-by: Michael Seifert <[email protected]>
  • Loading branch information
seifertm authored and Tinche committed May 30, 2021
1 parent 29a4265 commit e3ec312
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_hypothesis_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

@pytest.fixture(scope="module")
def event_loop():
loop = asyncio.get_event_loop()
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()


@given(st.integers())
Expand Down

0 comments on commit e3ec312

Please sign in to comment.