The stranger[0] membership assert was circular (it re-found an element taken from the same list) and raised IndexError instead of a useful message when the Timer did nothing. Assert the list is non-empty and shutdown-only in one line. The trailing time.sleep(0.2) did no work: every stranger event is recorded before woken.set(), and the owner's close events happen before pytest.raises exits.