Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tests/test_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,16 @@ def test_idle(self, updater, caplog):
with caplog.at_level(logging.INFO):
updater.idle()

rec = caplog.records[-1]
assert rec.msg.startswith('Received signal {}'.format(signal.SIGTERM))
assert rec.levelname == 'INFO'
rec1, rec2 = caplog.records[-1], caplog.records[-2]

def test1(rec):
return rec.msg.startswith('Received signal {}'.format(signal.SIGTERM))

def test2(rec):
return rec.levelname == 'INFO'

assert test1(rec1) or test1(rec2)
assert test2(rec1) or test2(rec2)

# If we get this far, idle() ran through
sleep(.5)
Expand Down