]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Fix workflow test window fail
authorCaselIT <cfederico87@gmail.com>
Tue, 19 Jan 2021 20:43:32 +0000 (15:43 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Tue, 19 Jan 2021 20:43:32 +0000 (15:43 -0500)
Need to disable asyncio before calling into pytest session start or windows will fails randomly.

Closes: #783
Pull-request: https://github.com/sqlalchemy/alembic/pull/783
Pull-request-sha: c92f7a2c0460899c942fcc668cbffe672b59df01

Change-Id: I9026334db651aa977fbc809494f449e38ca16a6f

tests/conftest.py
tox.ini

index 325bb45cc88b76d49f4ee46e5252396bd0776d57..fc3871f5996ee9c7c9b77a4906036147df8fa98a 100755 (executable)
@@ -34,6 +34,14 @@ with open(bootstrap_file) as f:
     code = compile(f.read(), "bootstrap.py", "exec")
     to_bootstrap = "pytest"
     exec(code, globals(), locals())
+
+    try:
+        from sqlalchemy.testing import asyncio
+    except ImportError:
+        pass
+    else:
+        asyncio.ENABLE_ASYNCIO = False
+
     from sqlalchemy.testing.plugin.pytestplugin import *  # noqa
 
     wrap_pytest_sessionstart = pytest_sessionstart  # noqa
diff --git a/tox.ini b/tox.ini
index fd1ce31014d3870bbca2a10b8b3ff18e4c66330b..01c695a4e635ae6caf1f5d0ef54a663906e424e5 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -34,7 +34,7 @@ usedevelop=
 # if -n is used, we're working in brand new DBs anyway
 setenv=
     BASECOMMAND=python -m pytest --rootdir {toxinidir}
-    WORKERS=-n4
+    WORKERS={env:TOX_WORKERS:-n4}
     sqla079: WORKERS=--dropfirst
     cov: COVERAGE={[testenv]cov_args}
     sqlite: SQLITE={env:TOX_SQLITE:--db sqlite}