summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading_local.py
diff options
context:
space:
mode:
authorJim Fulton <jim@zope.com>2004-07-14 19:11:50 (GMT)
committerJim Fulton <jim@zope.com>2004-07-14 19:11:50 (GMT)
commitd15dc06df062fdf0fe8badec2982c6c5e0e28eb0 (patch)
treee0295c2c22fa7c2e702b37a1d7afd77547a8894f /Lib/test/test_threading_local.py
parente827437f45510d9cdd1e7fa561da8084f69ca698 (diff)
downloadcpython-d15dc06df062fdf0fe8badec2982c6c5e0e28eb0.zip
cpython-d15dc06df062fdf0fe8badec2982c6c5e0e28eb0.tar.gz
cpython-d15dc06df062fdf0fe8badec2982c6c5e0e28eb0.tar.bz2
Implemented thread-local data as proposed on python-dev:
http://mail.python.org/pipermail/python-dev/2004-June/045785.html
Diffstat (limited to 'Lib/test/test_threading_local.py')
-rw-r--r--Lib/test/test_threading_local.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py
new file mode 100644
index 0000000..1258455
--- /dev/null
+++ b/Lib/test/test_threading_local.py
@@ -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()