From bb43af053dc1a4edc11a9c5d245e7f68c2dfa6a2 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 24 Mar 2024 11:43:33 -0400 Subject: [PATCH] remove restore_asyncio hack we have backported the asnycio.Runner from 2.1 so we dont need this hack anymore; it fails if greenlet is not installed Change-Id: I9e2ce09f9987ba5a4a78881475d85b9fa24e5bb4 --- test/base/test_tutorials.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/test/base/test_tutorials.py b/test/base/test_tutorials.py index 7543b1c100..d86322e12e 100644 --- a/test/base/test_tutorials.py +++ b/test/base/test_tutorials.py @@ -1,6 +1,5 @@ from __future__ import annotations -import asyncio import doctest import logging import os @@ -178,19 +177,8 @@ class DocTest(fixtures.TestBase): def test_orm_quickstart(self): self._run_doctest("orm/quickstart.rst") - @config.fixture(scope="class") - def restore_asyncio(self): - # NOTE: this is required since test_asyncio will remove the global - # loop. 2.1 uses runners that don't require this hack - yield - ep = asyncio.get_event_loop_policy() - try: - ep.get_event_loop() - except RuntimeError: - ep.set_event_loop(ep.new_event_loop()) - @requires.greenlet - def test_asyncio(self, restore_asyncio): + def test_asyncio(self): try: make_url("sqlite+aiosqlite://").get_dialect().import_dbapi() except ImportError: -- 2.47.2