]> granicus.if.org Git - python/commitdiff
bpo-31234: Join timers in test_threading (#3598)
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 15 Sep 2017 12:37:42 +0000 (05:37 -0700)
committerGitHub <noreply@github.com>
Fri, 15 Sep 2017 12:37:42 +0000 (05:37 -0700)
Call the .join() method of threading.Timer timers to prevent the
"threading_cleanup() failed to cleanup 1 threads" warning.

Lib/test/test_threading.py

index af6796cd2e6242d6ffcf8a0e7729a4dfa5f871f7..f7c3680bda379b5ab17fe7d5a16f99ed64649857 100644 (file)
@@ -1099,6 +1099,8 @@ class TimerTests(BaseTestCase):
         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()))