diff --git a/core/_tests/helpers/test_http.py b/core/_tests/helpers/test_http.py index f9c018d36..e899dcb76 100644 --- a/core/_tests/helpers/test_http.py +++ b/core/_tests/helpers/test_http.py @@ -2,8 +2,10 @@ from __future__ import absolute_import import unittest -from mock import patch +# pylint: disable=import-error from mock import call +from mock import patch +# pylint: enable=import-error from core.helpers.http import HTTPClientZabbix diff --git a/core/_tests/helpers/test_setup_teardown.py b/core/_tests/helpers/test_setup_teardown.py index cb5d03801..2f1fe744b 100644 --- a/core/_tests/helpers/test_setup_teardown.py +++ b/core/_tests/helpers/test_setup_teardown.py @@ -3,8 +3,10 @@ from __future__ import print_function import unittest +# pylint: disable=import-error from mock import call from mock import patch +# pylint: enable=import-error from core.helpers import setup_teardown @@ -159,6 +161,11 @@ class TestWrappers(unittest.TestCase): '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.__call_in_context') @@ -166,12 +173,6 @@ class TestSetupTeardown(unittest.TestCase): def test_basic(self, call_in, getargs): arg = True - def setup_func(): - pass - - def teardown_func(): - pass - @setup_teardown.setup_teardown() def positive_example(arg): return arg diff --git a/core/_tests/models/test_collector_client.py b/core/_tests/models/test_collector_client.py index 14f0c45f9..1d1f20c63 100644 --- a/core/_tests/models/test_collector_client.py +++ b/core/_tests/models/test_collector_client.py @@ -3,8 +3,10 @@ from __future__ import unicode_literals import unittest -from mock import patch +# pylint: disable=import-error from mock import call +from mock import patch +# pylint: enable=import-error from core.models.collector_client import CollectorClient diff --git a/tox.ini b/tox.ini index 204637b06..a9f39a8f4 100644 --- a/tox.ini +++ b/tox.ini @@ -49,7 +49,7 @@ deps= {[testenv]deps} pylint 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] @@ -91,4 +91,5 @@ deps = {[testenv]deps} commands = py.test --cov-config .coveragerc --cov-report html --cov=core core/_tests - coverage report + coverage html -d {envlogdir} + coverage report --fail-under 75