diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-01-02 10:55:21 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-01-02 19:08:25 -0500 |
commit | 5ba427f6daad4e7224267d11f7c6d99bd68f3d0e (patch) | |
tree | a6c7c112c0eb078521b0281c804578a63aa3810f /lib/sqlalchemy/testing/asyncio.py | |
parent | 2581655c545a0cf705e0347e81cd092896d3207c (diff) | |
download | sqlalchemy-5ba427f6daad4e7224267d11f7c6d99bd68f3d0e.tar.gz |
Repair async test refactor
in I4940d184a4dc790782fcddfb9873af3cca844398 we reworked how async
tests run but apparently the async tests in test/ext/asyncio
are reporting success without being run. This patch pushes
pytestplugin further so that it won't instrument any test
or function overall that declares itself async. This removes
the need for the __async_wrap__ flag and also allows us to
use a more strict "run_async_test" function that always
runs the asyncio event loop from the top.
Also start working asyncio into main testing suite.
Change-Id: If7144e951a9db67eb7ea73b377f81c4440d39819
Diffstat (limited to 'lib/sqlalchemy/testing/asyncio.py')
-rw-r--r-- | lib/sqlalchemy/testing/asyncio.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/asyncio.py b/lib/sqlalchemy/testing/asyncio.py index 52386d33e..bdf730a4c 100644 --- a/lib/sqlalchemy/testing/asyncio.py +++ b/lib/sqlalchemy/testing/asyncio.py @@ -22,12 +22,17 @@ import inspect from . import config from ..util.concurrency import _util_async_run +from ..util.concurrency import _util_async_run_coroutine_function # may be set to False if the # --disable-asyncio flag is passed to the test runner. ENABLE_ASYNCIO = True +def _run_coroutine_function(fn, *args, **kwargs): + return _util_async_run_coroutine_function(fn, *args, **kwargs) + + def _assume_async(fn, *args, **kwargs): """Run a function in an asyncio loop unconditionally. |