summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.appveyor.yml5
-rw-r--r--.coveragerc6
-rw-r--r--.gitignore4
-rw-r--r--.travis.yml2
-rw-r--r--scripts/dev/check_coverage.py6
-rw-r--r--tox.ini85
6 files changed, 57 insertions, 51 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 584bbebf9..a7b22e9f8 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -12,9 +12,8 @@ install:
- C:\Python27\python -u scripts\dev\ci_install.py
test_script:
- - C:\Python34\Scripts\tox -e smoke
- - C:\Python34\Scripts\tox -e smoke-frozen
- - C:\Python34\Scripts\tox -e unittests
+ - C:\Python34\Scripts\tox -e py34
- C:\Python34\Scripts\tox -e unittests-frozen
+ - C:\Python34\Scripts\tox -e smoke-frozen
- C:\Python34\Scripts\tox -e pyflakes
- C:\Python34\Scripts\tox -e pylint
diff --git a/.coveragerc b/.coveragerc
index 16bebb0cc..b1c620b3b 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -12,3 +12,9 @@ exclude_lines =
raise AssertionError
raise NotImplementedError
if __name__ == ["']__main__["']:
+
+[html]
+directory=.htmlcov
+
+[xml]
+output=.coverage.xml
diff --git a/.gitignore b/.gitignore
index cc23379f9..2fa6fb2b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,8 +20,8 @@ __pycache__
/qutebrowser/html/doc/
/.venv
/.coverage
-/htmlcov
-/coverage.xml
+/.htmlcov
+/.coverage.xml
/.tox
/testresults.html
/.cache
diff --git a/.travis.yml b/.travis.yml
index c5ff88926..d72073926 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,7 +17,7 @@ install:
- python scripts/dev/ci_install.py
script:
- - xvfb-run -s "-screen 0 640x480x16" tox -e unittests,smoke
+ - xvfb-run -s "-screen 0 640x480x16" tox -e py34
- tox -e misc
- tox -e pep257
- tox -e pyflakes
diff --git a/scripts/dev/check_coverage.py b/scripts/dev/check_coverage.py
index d63a026ea..18b6e61d7 100644
--- a/scripts/dev/check_coverage.py
+++ b/scripts/dev/check_coverage.py
@@ -67,10 +67,14 @@ def main():
"""
utils.change_cwd()
+ if sys.platform != 'linux':
+ print("Skipping coverage checks on non-Linux system.")
+ sys.exit()
+
for path in PERFECT_FILES:
assert os.path.exists(os.path.join(*path.split('/'))), path
- with open('coverage.xml', encoding='utf-8') as f:
+ with open('.coverage.xml', encoding='utf-8') as f:
tree = ElementTree.parse(f)
classes = tree.getroot().findall('./packages/package/classes/class')
diff --git a/tox.ini b/tox.ini
index df926ab5b..ef5b69430 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,23 +4,14 @@
# and then run "tox" from this directory.
[tox]
-envlist = smoke,unittests,misc,pep257,pyflakes,pep8,mccabe,pylint,pyroma,check-manifest
+envlist = smoke,py34,misc,pep257,pyflakes,pep8,mccabe,pylint,pyroma,check-manifest
[testenv]
-passenv = PYTHON
-basepython = python3
-
-[testenv:mkvenv]
-commands = {envpython} scripts/link_pyqt.py --tox {envdir}
-envdir = {toxinidir}/.venv
-usedevelop = true
-
-[testenv:unittests]
# https://bitbucket.org/hpk42/tox/issue/246/ - only needed for Windows though
setenv =
QT_QPA_PLATFORM_PLUGIN_PATH={envdir}/Lib/site-packages/PyQt5/plugins/platforms
PYTEST_QT_API=pyqt5
-passenv = PYTHON DISPLAY XAUTHORITY HOME
+passenv = PYTHON DISPLAY XAUTHORITY HOME USERNAME USER
deps =
-r{toxinidir}/requirements.txt
py==1.4.30
@@ -31,15 +22,26 @@ deps =
pytest-html==1.3.2
hypothesis==1.10.1
hypothesis-pytest==0.15.1
+ coverage==3.7.1
+ pytest-cov==2.0.0
+ cov-core==1.15.0
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}
- {envpython} -m py.test --strict -rfEsw {posargs:tests}
+ {envpython} -m py.test --strict -rfEsw --cov qutebrowser --cov-report html --cov-report xml --cov-report= {posargs:tests}
+ {envpython} scripts/dev/check_coverage.py
+ {envpython} -m qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ":later 500 quit"
+
+[testenv:mkvenv]
+basepython = python3
+commands = {envpython} scripts/link_pyqt.py --tox {envdir}
+envdir = {toxinidir}/.venv
+usedevelop = true
[testenv:unittests-watch]
-setenv = {[testenv:unittests]setenv}
-passenv = {[testenv:unittests]passenv}
+basepython = python3
+passenv = {[testenv]passenv}
deps =
- {[testenv:unittests]deps}
+ {[testenv]deps}
pytest-testmon==0.6
pytest-watch==3.2.0
commands =
@@ -47,40 +49,32 @@ commands =
{envdir}/bin/ptw -- --testmon --strict -rfEsw {posargs:tests}
[testenv:unittests-frozen]
-setenv = {[testenv:unittests]setenv}
-passenv = {[testenv:unittests]passenv}
+basepython = python3
+passenv = {[testenv]passenv}
skip_install = true
deps =
- {[testenv:unittests]deps}
+ {[testenv]deps}
cx_Freeze==4.3.4
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}
{envpython} scripts/dev/freeze_tests.py build_exe -b {envdir}/build
{envdir}/build/run-frozen-tests --strict -rfEsw {posargs}
-[testenv:coverage]
-passenv = PYTHON DISPLAY XAUTHORITY HOME
-deps =
- {[testenv:unittests]deps}
- coverage==3.7.1
- pytest-cov==2.0.0
- cov-core==1.15.0
-commands =
- {envpython} scripts/link_pyqt.py --tox {envdir}
- {envpython} -m py.test --strict -rfEswx -v --cov qutebrowser --cov-report term --cov-report html --cov-report xml {posargs:tests}
- {envpython} scripts/dev/check_coverage.py
-
[testenv:misc]
+basepython = python3
# For global .gitignore files
passenv = HOME
+deps =
commands =
{envpython} scripts/dev/misc_checks.py git
{envpython} scripts/dev/misc_checks.py vcs
{envpython} scripts/dev/misc_checks.py spelling
[testenv:pylint]
+basepython = python3
skip_install = true
setenv = PYTHONPATH={toxinidir}/scripts/dev
+passenv =
deps =
-r{toxinidir}/requirements.txt
astroid==1.3.8
@@ -95,9 +89,10 @@ commands =
{envpython} scripts/dev/run_pylint_on_tests.py --rcfile=.pylintrc --output-format=colorized --reports=no --expected-line-ending-format=LF
[testenv:pep257]
+basepython = python3
skip_install = true
-deps = pep257==0.6.0
passenv = PYTHON LANG
+deps = pep257==0.6.0
# Disabled checks:
# D102: Missing docstring in public method (will be handled by others)
# D103: Missing docstring in public function (will be handled by others)
@@ -106,8 +101,10 @@ passenv = PYTHON LANG
commands = {envpython} -m pep257 scripts tests qutebrowser --ignore=D102,D103,D209,D402 '--match=(?!resources|test_*).*\.py'
[testenv:pyflakes]
+basepython = python3
# https://github.com/fschulze/pytest-flakes/issues/6
setenv = LANG=en_US.UTF-8
+passenv =
deps =
-r{toxinidir}/requirements.txt
py==1.4.30
@@ -119,6 +116,8 @@ commands =
{envpython} -m py.test -q --flakes --ignore=tests
[testenv:pep8]
+basepython = python3
+passenv =
deps =
-r{toxinidir}/requirements.txt
py==1.4.30
@@ -130,6 +129,8 @@ commands =
{envpython} -m py.test -q --pep8 --ignore=tests
[testenv:mccabe]
+basepython = python3
+passenv =
deps =
-r{toxinidir}/requirements.txt
py==1.4.30
@@ -141,7 +142,9 @@ commands =
{envpython} -m py.test -q --mccabe --ignore=tests
[testenv:pyroma]
+basepython = python3
skip_install = true
+passenv =
deps =
pyroma==1.8.2
docutils==0.12
@@ -150,7 +153,9 @@ commands =
{envdir}/bin/pyroma .
[testenv:check-manifest]
+basepython = python3
skip_install = true
+passenv =
deps =
check-manifest==0.25
commands =
@@ -158,8 +163,10 @@ commands =
{envdir}/bin/check-manifest --ignore 'qutebrowser/git-commit-id,qutebrowser/html/doc,qutebrowser/html/doc/*,*/__pycache__'
[testenv:docs]
+basepython = python3
skip_install = true
whitelist_externals = git
+passenv =
deps =
-r{toxinidir}/requirements.txt
commands =
@@ -168,22 +175,12 @@ commands =
git --no-pager diff --exit-code --stat
{envpython} scripts/asciidoc2html.py {posargs}
-[testenv:smoke]
-# https://bitbucket.org/hpk42/tox/issue/246/ - only needed for Windows though
-setenv = QT_QPA_PLATFORM_PLUGIN_PATH={envdir}/Lib/site-packages/PyQt5/plugins/platforms
-passenv = PYTHON DISPLAY XAUTHORITY HOME USERNAME USER
-deps =
- -r{toxinidir}/requirements.txt
-commands =
- {envpython} scripts/link_pyqt.py --tox {envdir}
- {envpython} -m qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ":later 500 quit"
-
[testenv:smoke-frozen]
-setenv = {[testenv:smoke]setenv}
-passenv = {[testenv:smoke]passenv}
+basepython = python3
+passenv = {[testenv]passenv}
skip_install = true
deps =
- {[testenv:smoke]deps}
+ {[testenv]deps}
cx_Freeze==4.3.4
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}