From 7b24ea8dfe1667fe00b87cac9f0a0ca670b6a86f Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 26 Jul 2019 12:58:04 +0200 Subject: Switch to Python 3.7 and Alpine 3.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also allows building docs as doc8 is broken due to latest OpenStack's upper-constraints. pylint is updated to 2.3.1 (lastest py3.7 version) It disables perm as umask is currently false on lf-virtual1. Change-Id: I8568eeafa44c5dba72e206c532c1f50e3ad547f2 Signed-off-by: Cédric Ollivier --- xtesting/tests/unit/core/test_behaveframework.py | 7 +++---- xtesting/tests/unit/core/test_feature.py | 1 + xtesting/tests/unit/core/test_testcase.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'xtesting/tests') diff --git a/xtesting/tests/unit/core/test_behaveframework.py b/xtesting/tests/unit/core/test_behaveframework.py index f18cac03..70ca9738 100644 --- a/xtesting/tests/unit/core/test_behaveframework.py +++ b/xtesting/tests/unit/core/test_behaveframework.py @@ -66,11 +66,10 @@ class ParseResultTesting(unittest.TestCase): data = [{'status': 'passed'}, {'status': 'passed'}] self._test_result(data, 100) - def test_count(self): + @mock.patch('six.moves.builtins.open', mock.mock_open()) + def test_count(self, *args): # pylint: disable=unused-argument self._response.extend([{'status': 'failed'}, {'status': 'skipped'}]) - with mock.patch('six.moves.builtins.open', mock.mock_open()), \ - mock.patch('json.load', mock.Mock( - return_value=self._response)): + with mock.patch('json.load', mock.Mock(return_value=self._response)): self.test.parse_results() self.assertEqual(self.test.details['pass_tests'], 1) self.assertEqual(self.test.details['fail_tests'], 1) diff --git a/xtesting/tests/unit/core/test_feature.py b/xtesting/tests/unit/core/test_feature.py index 30678798..785f6e16 100644 --- a/xtesting/tests/unit/core/test_feature.py +++ b/xtesting/tests/unit/core/test_feature.py @@ -29,6 +29,7 @@ class FakeTestCase(feature.Feature): class AbstractFeatureTesting(unittest.TestCase): def test_run_unimplemented(self): + # pylint: disable=abstract-class-instantiated with self.assertRaises(TypeError): feature.Feature(case_name="feature", project_name="xtesting") diff --git a/xtesting/tests/unit/core/test_testcase.py b/xtesting/tests/unit/core/test_testcase.py index 51ea6f35..fc612973 100644 --- a/xtesting/tests/unit/core/test_testcase.py +++ b/xtesting/tests/unit/core/test_testcase.py @@ -35,6 +35,7 @@ class FakeTestCase(testcase.TestCase): class AbstractTestCaseTesting(unittest.TestCase): def test_run_unimplemented(self): + # pylint: disable=abstract-class-instantiated with self.assertRaises(TypeError): testcase.TestCase(case_name="base", project_name="xtesting") -- cgit 1.2.3-korg