]> 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:20:34 +0000 (11:20 -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

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 b90a2ec58c0b0eb57db54867f710772b4603086d..656a4e98a33b2d9e64e756a3ac50babfc86fbf98 100644 (file)
@@ -392,7 +392,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:
 
index 5b3443d1a3d848e6fdfca3c314b0ba2e6999893b..38d962fef7bdd151c6b822d5b3b71ffb2f116c86 100644 (file)
@@ -21,6 +21,7 @@ from __future__ import annotations
 
 import platform
 
+from . import asyncio as _test_asyncio
 from . import config
 from . import exclusions
 from . import only_on
@@ -1509,6 +1510,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: