We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5154d41 commit 8b26b23Copy full SHA for 8b26b23
Lib/test/test_threading.py
@@ -1219,18 +1219,18 @@ def test_join_finished_daemon_thread_in_finalization(self):
1219
import threading
1220
done = threading.Event()
1221
1222
- def loop():
+ def set_event():
1223
done.set()
1224
1225
-
1226
class Cycle:
1227
def __init__(self):
1228
self.self_ref = self
1229
- self.thr = threading.Thread(target=loop, daemon=True)
+ self.thr = threading.Thread(target=set_event, daemon=True)
1230
self.thr.start()
1231
- done.wait()
+ self.thr.join()
1232
1233
def __del__(self):
+ assert done.is_set()
1234
assert not self.thr.is_alive()
1235
self.thr.join()
1236
0 commit comments