Skip to content

Commit

Permalink
Fix workflow test window fail
Browse files Browse the repository at this point in the history
Need to disable asyncio before calling into pytest session start or windows will fails randomly.

Closes: sqlalchemy#783
Pull-request: sqlalchemy#783
Pull-request-sha: c92f7a2

Change-Id: I9026334db651aa977fbc809494f449e38ca16a6f
  • Loading branch information
CaselIT authored and sqla-tester committed Jan 19, 2021
1 parent f902d0c commit e43d175
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit e43d175

Please sign in to comment.