summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-02-25 22:07:43 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-02-25 22:07:43 (GMT)
commit0bd4deba383b1c7f05a4e0c94f1d4b96050a1308 (patch)
treefd95fcfc38af8fceb8e56409f63e4e2bd30e0c52 /Lib/test/test_threading.py
parent4bc685752f9f1056545ab121db833a4a68dd794c (diff)
downloadcpython-0bd4deba383b1c7f05a4e0c94f1d4b96050a1308.zip
cpython-0bd4deba383b1c7f05a4e0c94f1d4b96050a1308.tar.gz
cpython-0bd4deba383b1c7f05a4e0c94f1d4b96050a1308.tar.bz2
Issue #6064: Add a `daemon` keyword argument to the threading.Thread
and multiprocessing.Process constructors in order to override the default behaviour of inheriting the daemonic property from the current thread/process.
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index ecbbdbf..13a428d 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -427,6 +427,14 @@ class ThreadTests(BaseTestCase):
t.daemon = True
self.assertTrue('daemon' in repr(t))
+ def test_deamon_param(self):
+ t = threading.Thread()
+ self.assertFalse(t.daemon)
+ t = threading.Thread(daemon=False)
+ self.assertFalse(t.daemon)
+ t = threading.Thread(daemon=True)
+ self.assertTrue(t.daemon)
+
class ThreadJoinOnShutdown(BaseTestCase):