From: Mike Bayer Date: Sun, 24 Mar 2024 15:43:33 +0000 (-0400) Subject: remove restore_asyncio hack X-Git-Tag: rel_2_0_30~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb43af053dc1a4edc11a9c5d245e7f68c2dfa6a2;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 --- 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: