2004-07-14 16:11:50 -03:00
|
|
|
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
|
2004-08-28 11:58:31 -03:00
|
|
|
def setUp(test):
|
2004-07-14 16:11:50 -03:00
|
|
|
_threading_local.local = _local
|
2004-08-28 11:58:31 -03:00
|
|
|
def tearDown(test):
|
2004-07-14 16:11:50 -03:00
|
|
|
_threading_local.local = local_orig
|
|
|
|
suite.addTest(DocTestSuite('_threading_local',
|
|
|
|
setUp=setUp, tearDown=tearDown)
|
|
|
|
)
|
|
|
|
|
2007-04-25 14:29:52 -03:00
|
|
|
test_support.run_unittest(suite)
|
2004-07-14 16:11:50 -03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
test_main()
|