diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-11-09 11:22:02 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-11-09 13:22:19 +0100 |
commit | 9dd6822f734fb5b231cc0aa81b6c4d5352e2d7df (patch) | |
tree | 255971cb7fd3971f0be34103bd99ac4ca86990d2 /xtesting/core/behaveframework.py | |
parent | d130de7e57f8394104654da3f37afb631538aa2b (diff) |
Leverage latest pylint features
It adds encoding in all open call and leverage f-strings.
Change-Id: I70ccd2bfcadae44929d5874f98fa3bf4ff644488
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 17739d718901a10f7ec0aaf9a6d53141294a347d)
Diffstat (limited to 'xtesting/core/behaveframework.py')
-rw-r--r-- | xtesting/core/behaveframework.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xtesting/core/behaveframework.py b/xtesting/core/behaveframework.py index 3dc60384..6003c4ab 100644 --- a/xtesting/core/behaveframework.py +++ b/xtesting/core/behaveframework.py @@ -41,7 +41,7 @@ class BehaveFramework(testcase.TestCase): def parse_results(self): """Parse output.json and get the details in it.""" - with open(self.json_file) as stream_: + with open(self.json_file, encoding='utf-8') as stream_: self.response = json.load(stream_) if self.response: self.total_tests = len(self.response) @@ -87,11 +87,11 @@ class BehaveFramework(testcase.TestCase): except Exception: # pylint: disable=broad-except self.__logger.exception("Cannot create %s", self.res_dir) return self.EX_RUN_ERROR - config = ['--junit', '--junit-directory={}'.format(self.res_dir), - '--format=json', '--outfile={}'.format(self.json_file)] + config = ['--junit', f'--junit-directory={self.res_dir}', + '--format=json', f'--outfile={self.json_file}'] html_file = os.path.join(self.res_dir, 'output.html') config += ['--format=behave_html_formatter:HTMLFormatter', - '--outfile={}'.format(html_file)] + f'--outfile={html_file}'] if kwargs.get("tags", False): config += ['--tags='+','.join(kwargs.get("tags", []))] if kwargs.get("console", False): |