Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 4556e7e002fb21ddd9e4b16c7266877a4d99ea42 authored by Martin v. Löwis on 19 December 2008, 15:02:52 UTC
Prepare for 2.4.6.
Tip revision: 4556e7e
test_threading_local.py
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(test):
            _threading_local.local = _local
        def tearDown(test):
            _threading_local.local = local_orig
        suite.addTest(DocTestSuite('_threading_local',
                                   setUp=setUp, tearDown=tearDown)
                      )

    test_support.run_suite(suite)

if __name__ == '__main__':
    test_main()
back to top