Skip to content

Commit

Permalink
Adjust test condition to look only for engine related warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarquis committed Apr 12, 2024
1 parent 0891450 commit e40f542
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ def test_announce_to_reachable_engine(
# This is not a good way to test the app as any other warnings will make the test
# passes.
warning_logs_found = False
# for record in caplog.records:
# if record.levelname == "WARNING":
# warning_logs_found = True
# break
for record in caplog.records:
if record.levelname == "WARNING":
if "Failed to notify the engine" in record.message:
warning_logs_found = True
break

assert not warning_logs_found

Expand All @@ -134,8 +135,9 @@ def test_announce_to_unreachable_engine(
warning_logs_found = False
for record in caplog.records:
if record.levelname == "WARNING":
warning_logs_found = True
break
if "Failed to notify the engine" in record.message:
warning_logs_found = True
break

assert warning_logs_found

Expand Down

0 comments on commit e40f542

Please sign in to comment.