Skip to content

Commit f963b72

Browse files
committed
Some format update
1 parent 3a82a3d commit f963b72

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

reportportal_client/steps/__init__.py

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ def __init__(self, rp_client):
6666
"""
6767
self.client = rp_client
6868

69-
def start_nested_step(self,
70-
name,
71-
start_time,
72-
parameters=None,
73-
**kwargs):
69+
def start_nested_step(self, name, start_time, parameters=None, **_):
7470
"""Start Nested Step on ReportPortal.
7571
7672
:param name: Nested Step name
@@ -80,16 +76,10 @@ def start_nested_step(self,
8076
parent_id = self.client.current_item()
8177
if not parent_id:
8278
return
83-
return self.client.start_test_item(name, start_time, 'step',
84-
has_stats=False,
85-
parameters=parameters,
86-
parent_item_id=parent_id)
87-
88-
def finish_nested_step(self,
89-
item_id,
90-
end_time,
91-
status=None,
92-
**kwargs):
79+
return self.client.start_test_item(
80+
name, start_time, 'step', has_stats=False, parameters=parameters, parent_item_id=parent_id)
81+
82+
def finish_nested_step(self, item_id, end_time, status=None, **_):
9383
"""Finish a Nested Step on ReportPortal.
9484
9585
:param item_id: Nested Step item ID
@@ -125,16 +115,14 @@ def __enter__(self):
125115
rp_client = self.client or current()
126116
if not rp_client:
127117
return
128-
self.__item_id = rp_client.step_reporter \
129-
.start_nested_step(self.name, timestamp(), parameters=self.params)
118+
self.__item_id = rp_client.step_reporter.start_nested_step(self.name, timestamp(), parameters=self.params)
130119
if self.params:
131120
param_list = [
132121
str(key) + ": " + str(value)
133122
for key, value in sorted(self.params.items())
134123
]
135124
param_str = 'Parameters: ' + '; '.join(param_list)
136-
rp_client.log(timestamp(), param_str, level='INFO',
137-
item_id=self.__item_id)
125+
rp_client.log(timestamp(), param_str, level='INFO', item_id=self.__item_id)
138126

139127
def __exit__(self, exc_type, exc_val, exc_tb):
140128
"""Exit the runtime context related to this object."""
@@ -148,8 +136,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
148136
step_status = self.status
149137
if any((exc_type, exc_val, exc_tb)):
150138
step_status = 'FAILED'
151-
rp_client.step_reporter \
152-
.finish_nested_step(self.__item_id, timestamp(), step_status)
139+
rp_client.step_reporter.finish_nested_step(self.__item_id, timestamp(), step_status)
153140

154141
def __call__(self, func):
155142
"""Wrap and call a function reference.

0 commit comments

Comments
 (0)