[Python-checkins] bpo-31234: Join timers in test_threading (#3598)

Victor Stinner webhook-mailer at python.org
Fri Sep 15 08:37:45 EDT 2017


https://github.com/python/cpython/commit/da3e5cf961f9bcc4bb376386cfe7a2865325086c
commit: da3e5cf961f9bcc4bb376386cfe7a2865325086c
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-09-15T05:37:42-07:00
summary:

bpo-31234: Join timers in test_threading (#3598)

Call the .join() method of threading.Timer timers to prevent the
"threading_cleanup() failed to cleanup 1 threads" warning.

files:
M Lib/test/test_threading.py

diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index af6796cd2e6..f7c3680bda3 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()))



More information about the Python-checkins mailing list