From 17739d718901a10f7ec0aaf9a6d53141294a347d Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 9 Nov 2021 11:22:02 +0100 Subject: Leverage latest pylint features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It adds encoding in all open call and leverage f-strings. Change-Id: I70ccd2bfcadae44929d5874f98fa3bf4ff644488 Signed-off-by: Cédric Ollivier --- xtesting/tests/unit/utils/test_decorators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xtesting/tests/unit/utils/test_decorators.py') diff --git a/xtesting/tests/unit/utils/test_decorators.py b/xtesting/tests/unit/utils/test_decorators.py index 2810df15..ae6ffa4b 100644 --- a/xtesting/tests/unit/utils/test_decorators.py +++ b/xtesting/tests/unit/utils/test_decorators.py @@ -24,8 +24,8 @@ from xtesting.utils import decorators __author__ = "Cedric Ollivier " DIR = '/dev' -FILE = '{}/null'.format(DIR) -URL = 'file://{}'.format(FILE) +FILE = f'{DIR}/null' +URL = f'file://{FILE}' class FakeTestCase(testcase.TestCase): @@ -108,7 +108,7 @@ class DecoratorsTesting(unittest.TestCase): create=True) as mock_open: test = self._get_testcase() self.assertEqual(test.push_to_db(), testcase.TestCase.EX_OK) - mock_open.assert_called_once_with(FILE, 'a') + mock_open.assert_called_once_with(FILE, 'a', encoding='utf-8') handle = mock_open() call_args, _ = handle.write.call_args self.assertIn('POST', call_args[0]) -- cgit 1.2.3-korg