From 3ac1a016c66b006538475455632c6ebd58af3f19 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 15 Sep 2017 14:09:58 +0200 Subject: [PATCH] bpo-31234: Join timers in test_threading Call the .join() method of threading.Timer timers to prevent the "threading_cleanup() failed to cleanup 1 threads" warning. --- Lib/test/test_threading.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index af6796cd2e6242d..f7c3680bda379b5 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1099,6 +1099,8 @@ def test_init_immutable_default_args(self): self.callback_event.wait() self.assertEqual(len(self.callback_args), 2) self.assertEqual(self.callback_args, [((), {}), ((), {})]) + timer1.join() + timer2.join() def _callback_spy(self, *args, **kwargs): self.callback_args.append((args[:], kwargs.copy()))