mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Implemented thread-local data as proposed on python-dev:
http://mail.python.org/pipermail/python-dev/2004-June/045785.html
This commit is contained in:
parent
e827437f45
commit
d15dc06df0
6 changed files with 571 additions and 1 deletions
26
Lib/test/test_threading_local.py
Normal file
26
Lib/test/test_threading_local.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
import unittest
|
||||
from doctest import DocTestSuite
|
||||
from test import test_support
|
||||
|
||||
def test_main():
|
||||
suite = DocTestSuite('_threading_local')
|
||||
|
||||
try:
|
||||
from thread import _local
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
import _threading_local
|
||||
local_orig = _threading_local.local
|
||||
def setUp():
|
||||
_threading_local.local = _local
|
||||
def tearDown():
|
||||
_threading_local.local = local_orig
|
||||
suite.addTest(DocTestSuite('_threading_local',
|
||||
setUp=setUp, tearDown=tearDown)
|
||||
)
|
||||
|
||||
test_support.run_suite(suite)
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_main()
|
Loading…
Add table
Add a link
Reference in a new issue