diff options
author | Ned Deily <nad@acm.org> | 2011-04-09 14:58:04 -0700 |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2011-04-09 14:58:04 -0700 |
commit | ab1f8c89b62456ffc1ea87c566310db38562832d (patch) | |
tree | 2511208f2c93349c263a516246e21a8c50340845 /Lib/test/test_threading.py | |
parent | ef9438e25526bdaa14be91b48d707bc28c71515c (diff) | |
parent | 6d2d57ed640aa0d3c7f724293a6d8f8d8b71ca03 (diff) | |
download | cpython-ab1f8c89b62456ffc1ea87c566310db38562832d.tar.gz |
Issue9670: Merge backout from 3.2.
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r-- | Lib/test/test_threading.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 5f99b2ea9f..c107652d26 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): @@ -677,6 +685,10 @@ class ThreadingExceptionTests(BaseTestCase): thread.start() self.assertRaises(RuntimeError, setattr, thread, "daemon", True) + def test_releasing_unacquired_lock(self): + lock = threading.Lock() + self.assertRaises(RuntimeError, lock.release) + class LockTests(lock_tests.LockTests): locktype = staticmethod(threading.Lock) |