aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/core/behaveframework.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2021-11-09 11:22:02 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2021-11-09 13:21:47 +0100
commit17739d718901a10f7ec0aaf9a6d53141294a347d (patch)
treea98e6d09a42016ceec90713adac681918a4a9c62 /xtesting/core/behaveframework.py
parent92681911699428a87ea56c0263832b96a93da3da (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>
Diffstat (limited to 'xtesting/core/behaveframework.py')
-rw-r--r--xtesting/core/behaveframework.py8
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):