summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-02-28 22:03:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-02-28 22:03:34 (GMT)
commitfcf81fd0310ba505c46d33a82f2b782578ed1a98 (patch)
tree8cdb6d911947e46dd99ac99a08a82cb736c4006e /Lib/test/test_threading.py
parentcfbcec3823892759017c1f3a1d1cb7fab4e84f69 (diff)
downloadcpython-fcf81fd0310ba505c46d33a82f2b782578ed1a98.zip
cpython-fcf81fd0310ba505c46d33a82f2b782578ed1a98.tar.gz
cpython-fcf81fd0310ba505c46d33a82f2b782578ed1a98.tar.bz2
Issue #11140: Lock.release() now raises a RuntimeError when attempting
to release an unacquired lock, as claimed in the threading documentation. The _thread.error exception is now an alias of RuntimeError.
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 13a428d..029218d 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -685,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)