]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
repair --disable-asyncio parameter
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Nov 2022 14:46:06 +0000 (09:46 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Nov 2022 16:23:02 +0000 (11:23 -0500)
Fixed issue where the ``--disable-asyncio`` parameter to the test suite
would fail to not actually run greenlet tests and would also not prevent
the suite from using a "wrapping" greenlet for the whole suite. This
parameter now ensures that no greenlet or asyncio use will occur within the
entire run when set.

Fixes: #8793
Change-Id: I87b510846b2cc24413cd54e7b7136e91aad3c309
(cherry picked from commit 7f7e961f46aeff5895bd34fec9e2e208862d7a6b)

doc/build/changelog/unreleased_14/8793.rst [new file with mode: 0644]
lib/sqlalchemy/testing/plugin/plugin_base.py
lib/sqlalchemy/testing/requirements.py

diff --git a/doc/build/changelog/unreleased_14/8793.rst b/doc/build/changelog/unreleased_14/8793.rst
new file mode 100644 (file)
index 0000000..36f1003
--- /dev/null
@@ -0,0 +1,9 @@
+.. change::
+    :tags: bug, tests
+    :tickets: 8793
+
+    Fixed issue where the ``--disable-asyncio`` parameter to the test suite
+    would fail to not actually run greenlet tests and would also not prevent
+    the suite from using a "wrapping" greenlet for the whole suite. This
+    parameter now ensures that no greenlet or asyncio use will occur within the
+    entire run when set.
index d59564e8e01bff8d523a4377f97881021ec7784d..c941332f3118448716778d3006030f85b8ad92be 100644 (file)
@@ -391,7 +391,7 @@ def _init_symbols(options, file_config):
     config._fixture_functions = _fixture_fn_class()
 
 
-@post
+@pre
 def _set_disable_asyncio(opt, file_config):
     if opt.disable_asyncio or not py3k:
         from sqlalchemy.testing import asyncio
index 7e8a030e3224f2bb8c55ded0ab429e76669bb5d2..069ff747dbb326c1fa35bb9e4d630ac29bc73db1 100644 (file)
@@ -18,6 +18,7 @@ to provide specific inclusion/exclusions.
 import platform
 import sys
 
+from . import asyncio as _test_asyncio
 from . import exclusions
 from . import only_on
 from .. import util
@@ -1393,6 +1394,9 @@ class SuiteRequirements(Requirements):
     @property
     def greenlet(self):
         def go(config):
+            if not _test_asyncio.ENABLE_ASYNCIO:
+                return False
+
             try:
                 import greenlet  # noqa: F401
             except ImportError: