Commit e40d032f authored by Stefan Behnel's avatar Stefan Behnel

add context manager test with threading.Lock which previously failed in Py2.6...

add context manager test with threading.Lock which previously failed in Py2.6 (by Wouter Bolsterlee)
parent 33f7f6f9
......@@ -124,6 +124,24 @@ def with_exception(exit_ret):
print("outer except")
def with_real_lock():
"""
>>> with_real_lock()
about to acquire lock
holding lock
lock no longer held
"""
from threading import Lock
lock = Lock()
print("about to acquire lock")
with lock:
print("holding lock")
print("lock no longer held")
def functions_in_with():
"""
>>> f = functions_in_with()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment