Skip to content

Commit 3cbb33b

Browse files
committed
Fix remove keywords for PASSED case. Add more tests
1 parent bc47c73 commit 3cbb33b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

robotframework_reportportal/listener.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,8 @@ def _log_message(self, message: LogMessage) -> None:
256256
return
257257

258258
if (
259-
not getattr(current_item, "posted", True)
260-
and getattr(current_item, "remove_data", False)
261-
and message.level not in ["ERROR", "WARN"]
262-
):
259+
not getattr(current_item, "posted", True) or getattr(current_item, "remove_data", False)
260+
) and message.level not in ["ERROR", "WARN"]:
263261
self.current_item.skipped_logs.append(message)
264262
elif (
265263
getattr(current_item, "matched_filter", None) is not WKUS_KEYWORD_MATCH

tests/integration/test_remove_keywords.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@
158158
0,
159159
"Content removed using the --remove-keywords option.",
160160
),
161+
(
162+
"examples/while_keyword.robot",
163+
"PASSED",
164+
0,
165+
["PASSED"] * 4,
166+
2,
167+
1,
168+
"Content removed using the --remove-keywords option.",
169+
),
161170
],
162171
)
163172
@mock.patch(REPORT_PORTAL_SERVICE)

0 commit comments

Comments
 (0)