From e3ec312c1d55b3688e4ce115df7791a0478582d1 Mon Sep 17 00:00:00 2001 From: Michael Seifert Date: Mon, 17 May 2021 16:08:54 +0200 Subject: [PATCH] Adjusted Hypothesis integration test to use the same event loop initialization 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 --- tests/test_hypothesis_integration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_hypothesis_integration.py b/tests/test_hypothesis_integration.py index 9c97e06c..39cb6075 100644 --- a/tests/test_hypothesis_integration.py +++ b/tests/test_hypothesis_integration.py @@ -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())