Split integration tests, run smoke via pytest.
This commit is contained in:
parent
44f594662a
commit
0b911d2e20
@ -12,6 +12,7 @@ install:
|
||||
|
||||
test_script:
|
||||
- C:\Python34\Scripts\tox -e py34
|
||||
- C:\Python34\Scripts\tox -e py34-integration
|
||||
- C:\Python34\Scripts\tox -e unittests-frozen
|
||||
- C:\Python34\Scripts\tox -e smoke-frozen
|
||||
- C:\Python34\Scripts\tox -e pylint
|
||||
|
@ -16,7 +16,7 @@ install:
|
||||
- python scripts/dev/ci_install.py
|
||||
|
||||
script:
|
||||
- xvfb-run -s "-screen 0 640x480x16" tox -e py34
|
||||
- xvfb-run -s "-screen 0 640x480x16" tox -e py34,py34-integration
|
||||
- tox -e misc
|
||||
- tox -e pep257
|
||||
- tox -e pyflakes
|
||||
|
@ -66,6 +66,15 @@ def pytest_collection_modifyitems(items):
|
||||
True, reason="No DISPLAY available")
|
||||
item.add_marker(skip_marker)
|
||||
|
||||
if hasattr(item, 'module'):
|
||||
module_path = os.path.relpath(
|
||||
item.module.__file__,
|
||||
os.path.commonprefix([__file__, item.module.__file__]))
|
||||
|
||||
module_root_dir = os.path.split(module_path)[0]
|
||||
if module_root_dir == 'integration':
|
||||
item.add_marker(pytest.mark.integration)
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
"""Add some custom markers."""
|
||||
|
33
tests/integration/test_smoke.py
Normal file
33
tests/integration/test_smoke.py
Normal file
@ -0,0 +1,33 @@
|
||||
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
|
||||
|
||||
# Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
|
||||
#
|
||||
# This file is part of qutebrowser.
|
||||
#
|
||||
# qutebrowser is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# qutebrowser is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""Test which simply runs qutebrowser to check if it starts properly."""
|
||||
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.not_frozen
|
||||
def test_smoke():
|
||||
argv = [sys.executable, '-m', 'qutebrowser', '--debug', '--no-err-windows',
|
||||
'--nowindow', '--temp-basedir', 'about:blank', ':later 500 quit']
|
||||
subprocess.check_call(argv)
|
13
tox.ini
13
tox.ini
@ -4,7 +4,7 @@
|
||||
# and then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
envlist = py34,misc,pep257,pyflakes,pep8,mccabe,pylint,pyroma,check-manifest
|
||||
envlist = py34,py34-integration,misc,pep257,pyflakes,pep8,mccabe,pylint,pyroma,check-manifest
|
||||
|
||||
[testenv]
|
||||
# https://bitbucket.org/hpk42/tox/issue/246/ - only needed for Windows though
|
||||
@ -27,9 +27,16 @@ deps =
|
||||
beautifulsoup4==4.4.0
|
||||
commands =
|
||||
{envpython} scripts/link_pyqt.py --tox {envdir}
|
||||
{envpython} -m py.test --strict -rfEsw --cov qutebrowser --cov-report xml --cov-report=html --cov-report= {posargs:tests}
|
||||
{envpython} -m py.test --strict -rfEsw -m 'not integration' --cov qutebrowser --cov-report xml --cov-report=html --cov-report= {posargs:tests}
|
||||
{envpython} scripts/dev/check_coverage.py {posargs}
|
||||
{envpython} -m qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ":later 500 quit"
|
||||
|
||||
[testenv:py34-integration]
|
||||
setenv = {[testenv]setenv}
|
||||
passenv = {[testenv]passenv}
|
||||
deps = {[testenv]deps}
|
||||
commands =
|
||||
{envpython} scripts/link_pyqt.py --tox {envdir}
|
||||
{envpython} -m py.test --strict -rfEsw -m 'integration' {posargs:tests}
|
||||
|
||||
[testenv:mkvenv]
|
||||
basepython = python3
|
||||
|
Loading…
Reference in New Issue
Block a user