From 3cbb33b2b1c9a06272bbb8075c706f46986daec6 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Fri, 27 Dec 2024 16:50:04 +0300 Subject: [PATCH] Fix remove keywords for PASSED case. Add more tests --- robotframework_reportportal/listener.py | 6 ++---- tests/integration/test_remove_keywords.py | 9 +++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/robotframework_reportportal/listener.py b/robotframework_reportportal/listener.py index 9c8b3f5..c19f6bd 100644 --- a/robotframework_reportportal/listener.py +++ b/robotframework_reportportal/listener.py @@ -256,10 +256,8 @@ def _log_message(self, message: LogMessage) -> None: return if ( - not getattr(current_item, "posted", True) - and getattr(current_item, "remove_data", False) - and message.level not in ["ERROR", "WARN"] - ): + not getattr(current_item, "posted", True) or getattr(current_item, "remove_data", False) + ) and message.level not in ["ERROR", "WARN"]: self.current_item.skipped_logs.append(message) elif ( getattr(current_item, "matched_filter", None) is not WKUS_KEYWORD_MATCH diff --git a/tests/integration/test_remove_keywords.py b/tests/integration/test_remove_keywords.py index 40df179..7338047 100644 --- a/tests/integration/test_remove_keywords.py +++ b/tests/integration/test_remove_keywords.py @@ -158,6 +158,15 @@ 0, "Content removed using the --remove-keywords option.", ), + ( + "examples/while_keyword.robot", + "PASSED", + 0, + ["PASSED"] * 4, + 2, + 1, + "Content removed using the --remove-keywords option.", + ), ], ) @mock.patch(REPORT_PORTAL_SERVICE)