Merge remote-tracking branch 'origin/pr/3349'

This commit is contained in:
Florian Bruhin 2017-12-04 06:32:46 +01:00
commit fe60556a34
3 changed files with 42 additions and 109 deletions

View File

@ -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

View File

@ -50,6 +50,7 @@ class CovtestHelper:
def run(self):
"""Run pytest with coverage for the given module.py."""
coveragerc = str(self._testdir.tmpdir / 'coveragerc')
self._monkeypatch.delenv('PYTEST_ADDOPTS', raising=False)
return self._testdir.runpytest('--cov=module',
'--cov-config={}'.format(coveragerc),
'--cov-report=xml',

146
tox.ini
View File

@ -13,120 +13,24 @@ 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
basepython =
py35: python3.5
py36: python3.6
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-tests.txt
pyqt: -r{toxinidir}/misc/requirements/requirements-pyqt.txt
pyqt571: PyQt5==5.7.1
pyqt58: PyQt5==5.8.2
pyqt59: PyQt5==5.9.2
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}
{envpython} -bb -m pytest {posargs:tests}
# test envs with PyQt5 from PyPI
[testenv:py35-pyqt56]
basepython = python3.5
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.6
commands = {envpython} -bb -m pytest {posargs:tests}
[testenv:py35-pyqt571]
basepython = python3.5
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.7.1
commands = {envpython} -bb -m pytest {posargs:tests}
[testenv:py36-pyqt571]
basepython = python3.6
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.7.1
commands = {envpython} -bb -m pytest {posargs:tests}
[testenv:py35-pyqt58]
basepython = python3.5
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.8.2
commands = {envpython} -bb -m pytest {posargs:tests}
[testenv:py36-pyqt58]
basepython = {env:PYTHON:python3.6}
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.8.2
commands = {envpython} -bb -m pytest {posargs:tests}
[testenv:py35-pyqt59]
basepython = python3.5
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.9.2
commands = {envpython} -bb -m pytest {posargs:tests}
[testenv:py36-pyqt59]
basepython = {env:PYTHON:python3.6}
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.9.2
commands = {envpython} -bb -m pytest {posargs:tests}
# test envs with coverage
[testenv:py35-pyqt59-cov]
basepython = python3.5
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.9.2
commands =
{envpython} -bb -m pytest --cov --cov-report xml --cov-report=html --cov-report= {posargs:tests}
{envpython} scripts/dev/check_coverage.py {posargs}
[testenv:py36-pyqt59-cov]
basepython = python3.6
setenv =
{[testenv]setenv}
QUTE_BDD_WEBENGINE=true
passenv = {[testenv]passenv}
deps =
{[testenv]deps}
PyQt5==5.9.2
commands =
{envpython} -bb -m pytest --cov --cov-report xml --cov-report=html --cov-report= {posargs:tests}
{envpython} scripts/dev/check_coverage.py {posargs}
cov: {envpython} scripts/dev/check_coverage.py {posargs}
# other envs
@ -196,23 +100,47 @@ setenv = PYTHONPATH={toxinidir}
commands =
{envpython} scripts/dev/run_vulture.py
[testenv:vulture-pyqtlink]
basepython = python3
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-vulture.txt
setenv = PYTHONPATH={toxinidir}
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}
{[testenv:vulture]commands}
[testenv:pylint]
basepython = {env:PYTHON:python3}
ignore_errors = true
passenv =
deps =
{[testenv]deps}
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-tests.txt
-r{toxinidir}/misc/requirements/requirements-pylint.txt
-r{toxinidir}/misc/requirements/requirements-pyqt.txt
commands =
{envpython} -m pylint scripts qutebrowser --output-format=colorized --reports=no {posargs}
{envpython} scripts/dev/run_pylint_on_tests.py {toxinidir} --output-format=colorized --reports=no {posargs}
[testenv:pylint-pyqtlink]
basepython = {env:PYTHON:python3}
ignore_errors = true
passenv =
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-tests.txt
-r{toxinidir}/misc/requirements/requirements-pylint.txt
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}
{[testenv:pylint]commands}
[testenv:pylint-master]
basepython = python3
passenv = {[testenv:pylint]passenv}
deps =
{[testenv]deps}
-r{toxinidir}/requirements.txt
-r{toxinidir}/misc/requirements/requirements-tests.txt
-r{toxinidir}/misc/requirements/requirements-pylint-master.txt
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}