Skip to content

Commit

Permalink
Fix logic in assert_warning_tokens.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Dec 13, 2023
1 parent bf61adc commit 4df98a3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/test_web_poet_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 4df98a3

Please sign in to comment.