From: CaselIT Date: Tue, 19 Jan 2021 20:43:32 +0000 (-0500) Subject: Fix workflow test window fail X-Git-Tag: rel_1_5_2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e43d175233f206336c0637488e9ed231f421539a;p=thirdparty%2Fsqlalchemy%2Falembic.git Fix workflow test window fail 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 --- diff --git a/tests/conftest.py b/tests/conftest.py index 325bb45c..fc3871f5 100755 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 fd1ce310..01c695a4 100644 --- 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}