Skip to content

Commit c44cb2a

Browse files
authored
Merge pull request #241 from reportportal/develop
Release
2 parents 00803f1 + 013dad4 commit c44cb2a

File tree

5 files changed

+15
-24
lines changed

5 files changed

+15
-24
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- Empty parameter Dict conversion, by @HardNorth
6+
7+
## [5.5.8]
48
### Removed
59
- Retries of requests ended with `504` HTTP status code, since it's not clear if the request was delivered or not, by @HardNorth
610
### Changed

reportportal_client/core/rp_requests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def _create_request(**kwargs) -> dict:
295295
attributes = dict_to_payload(kwargs['attributes'])
296296
request['attributes'] = attributes
297297
parameters = kwargs.get('parameters')
298-
if parameters and isinstance(parameters, dict):
298+
if parameters is not None and isinstance(parameters, dict):
299299
parameters = dict_to_payload(kwargs['parameters'])
300300
request['parameters'] = parameters
301301
return request

reportportal_client/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def dict_to_payload(dictionary: Optional[dict]) -> Optional[List[dict]]:
130130
:param dictionary: Dictionary containing tags/attributes
131131
:return list: List of tags/attributes in the required format
132132
"""
133-
if not dictionary:
133+
if dictionary is None:
134134
return dictionary
135135
my_dictionary = dict(dictionary)
136136

reportportal_client/steps/__init__.py

+8-21
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.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from setuptools import setup, find_packages
66

7-
__version__ = '5.5.8'
7+
__version__ = '5.5.9'
88

99
TYPE_STUBS = ['*.pyi']
1010

0 commit comments

Comments
 (0)