From df6ff55b7a34d543b9235bf71f0131b2598ff1c9 Mon Sep 17 00:00:00 2001 From: Ryan Farley Date: Fri, 1 Dec 2017 10:51:41 -0600 Subject: [PATCH] allow pytest to default to link_pyqt link_pyqt now checks for LINK_PYQT_SKIP, allowing pytest env names like `py36` to work properly without negative conditionals in tox.ini --- scripts/link_pyqt.py | 4 ++++ tox.ini | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/link_pyqt.py b/scripts/link_pyqt.py index 57eeb9138..82f8cbac5 100644 --- a/scripts/link_pyqt.py +++ b/scripts/link_pyqt.py @@ -205,6 +205,10 @@ def main(): args = parser.parse_args() if args.tox: + #workaround for the lack of negative factors in tox.ini + if 'LINK_PYQT_SKIP' in os.environ: + print('LINK_PYQT_SKIP set, exiting...') + sys.exit(0) executable = get_tox_syspython(args.path) else: executable = sys.executable diff --git a/tox.ini b/tox.ini index de41f2e0f..2ada5ab58 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ skipsdist = true setenv = QT_QPA_PLATFORM_PLUGIN_PATH={envdir}/Lib/site-packages/PyQt5/plugins/platforms PYTEST_QT_API=pyqt5 + pyqt{,56,571,58,59}: LINK_PYQT_SKIP=true pyqt{,56,571,58,59}: QUTE_BDD_WEBENGINE=true cov: PYTEST_ADDOPTS=--cov --cov-report xml --cov-report=html --cov-report= passenv = PYTHON DISPLAY XAUTHORITY HOME USERNAME USER CI TRAVIS XDG_* QUTE_* DOCKER @@ -27,7 +28,7 @@ deps = pyqt58: PyQt5==5.8.2 pyqt59: PyQt5==5.9.2 commands = - pyqtlink: {envpython} scripts/link_pyqt.py --tox {envdir} + {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} -bb -m pytest {posargs:tests} cov: {envpython} scripts/dev/check_coverage.py {posargs}