From 4df98a3d38ae20b73f4e933f3717900e425e6fc1 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Wed, 13 Dec 2023 18:52:24 +0400 Subject: [PATCH] Fix logic in assert_warning_tokens. --- tests/test_web_poet_rules.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_web_poet_rules.py b/tests/test_web_poet_rules.py index 48820d90..185c7929 100644 --- a/tests/test_web_poet_rules.py +++ b/tests/test_web_poet_rules.py @@ -139,13 +139,9 @@ def assert_deps(deps: List[Dict[str, Any]], expected: Dict[str, Any], size: int def assert_warning_tokens(caught_warnings, expected_warning_tokens): results = [] - for warning in caught_warnings: + for expected in expected_warning_tokens: results.append( - all( - True - for expected in expected_warning_tokens - if expected in str(warning.message) - ) + any(expected in str(warning.message) for warning in caught_warnings) ) assert all(results)