Make coverage report human-readable on gates
Make coverage report human-readable on gates Require minimal coverage of moved helpers: 75% Change-Id: I59c589e8626bfa23fbf4f06845db27775f9714a2
This commit is contained in:
parent
3b5d9b2f10
commit
e96978ddea
|
@ -2,8 +2,10 @@ from __future__ import absolute_import
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from mock import patch
|
# pylint: disable=import-error
|
||||||
from mock import call
|
from mock import call
|
||||||
|
from mock import patch
|
||||||
|
# pylint: enable=import-error
|
||||||
|
|
||||||
from core.helpers.http import HTTPClientZabbix
|
from core.helpers.http import HTTPClientZabbix
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,10 @@ from __future__ import print_function
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
# pylint: disable=import-error
|
||||||
from mock import call
|
from mock import call
|
||||||
from mock import patch
|
from mock import patch
|
||||||
|
# pylint: enable=import-error
|
||||||
|
|
||||||
from core.helpers import setup_teardown
|
from core.helpers import setup_teardown
|
||||||
|
|
||||||
|
@ -159,6 +161,11 @@ class TestWrappers(unittest.TestCase):
|
||||||
'cls was not filtered from @classmethod!'
|
'cls was not filtered from @classmethod!'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Allow to replace function by None in special cases
|
||||||
|
self.assertIsNone(
|
||||||
|
call_in_context(None, {'test_arg': 'test_val'})
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@patch('core.helpers.setup_teardown.__getcallargs', return_value={'arg': True})
|
@patch('core.helpers.setup_teardown.__getcallargs', return_value={'arg': True})
|
||||||
@patch('core.helpers.setup_teardown.__call_in_context')
|
@patch('core.helpers.setup_teardown.__call_in_context')
|
||||||
|
@ -166,12 +173,6 @@ class TestSetupTeardown(unittest.TestCase):
|
||||||
def test_basic(self, call_in, getargs):
|
def test_basic(self, call_in, getargs):
|
||||||
arg = True
|
arg = True
|
||||||
|
|
||||||
def setup_func():
|
|
||||||
pass
|
|
||||||
|
|
||||||
def teardown_func():
|
|
||||||
pass
|
|
||||||
|
|
||||||
@setup_teardown.setup_teardown()
|
@setup_teardown.setup_teardown()
|
||||||
def positive_example(arg):
|
def positive_example(arg):
|
||||||
return arg
|
return arg
|
||||||
|
|
|
@ -3,8 +3,10 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from mock import patch
|
# pylint: disable=import-error
|
||||||
from mock import call
|
from mock import call
|
||||||
|
from mock import patch
|
||||||
|
# pylint: enable=import-error
|
||||||
|
|
||||||
from core.models.collector_client import CollectorClient
|
from core.models.collector_client import CollectorClient
|
||||||
|
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -49,7 +49,7 @@ deps=
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
pylint
|
pylint
|
||||||
commands=
|
commands=
|
||||||
pylint --rcfile=.pylintrc_gerrit fuelweb_test system_test gates_tests fuel_tests run_system_test
|
pylint --rcfile=.pylintrc_gerrit fuelweb_test system_test gates_tests fuel_tests run_system_test core
|
||||||
|
|
||||||
|
|
||||||
[testenv:pylint-py27-fuelweb]
|
[testenv:pylint-py27-fuelweb]
|
||||||
|
@ -91,4 +91,5 @@ deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
commands =
|
commands =
|
||||||
py.test --cov-config .coveragerc --cov-report html --cov=core core/_tests
|
py.test --cov-config .coveragerc --cov-report html --cov=core core/_tests
|
||||||
coverage report
|
coverage html -d {envlogdir}
|
||||||
|
coverage report --fail-under 75
|
||||||
|
|
Loading…
Reference in New Issue