Issue #3806: LockTests in test_imp should be skipped when thread is not available.

Reviewed by Benjamin Peterson.
This commit is contained in:
Hirokazu Yamamoto 2008-09-09 07:33:27 +00:00
parent 8530e8590f
commit 36144098e3
1 changed files with 10 additions and 4 deletions

View File

@ -85,10 +85,16 @@ class ImportTests(unittest.TestCase):
def test_main():
support.run_unittest(
LockTests,
ImportTests,
)
tests = [
ImportTests,
]
try:
import _thread
except ImportError:
pass
else:
tests.append(LockTests)
support.run_unittest(*tests)
if __name__ == "__main__":
test_main()