Skip coverage checks when tests are filtered.

This commit is contained in:
Florian Bruhin 2015-08-12 06:41:41 +02:00
parent cf45d97046
commit 83a4451f93
2 changed files with 11 additions and 1 deletions

View File

@ -20,6 +20,7 @@
"""Enforce perfect coverage on some files."""
import os
import sys
import os.path
@ -73,6 +74,15 @@ def main():
if sys.platform != 'linux':
print("Skipping coverage checks on non-Linux system.")
sys.exit()
elif '-k' in sys.argv[1:]:
print("Skipping coverage checks because -k is given.")
sys.exit()
elif '-m' in sys.argv[1:]:
print("Skipping coverage checks because -m is given.")
sys.exit()
elif any(arg.startswith('tests' + os.sep) for arg in sys.argv[1:]):
print("Skipping coverage checks because a filename is given.")
sys.exit()
for path in PERFECT_FILES:
assert os.path.exists(os.path.join(*path.split('/'))), path

View File

@ -28,7 +28,7 @@ deps =
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}
{envpython} -m py.test --strict -rfEsw --cov qutebrowser --cov-report xml --cov-report= {posargs:tests}
{envpython} scripts/dev/check_coverage.py
{envpython} scripts/dev/check_coverage.py {posargs}
{envpython} -m qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ":later 500 quit"
[testenv:mkvenv]