Issue #19572: More silently skipped tests explicitly skipped.
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 77e44be..1bdc47a 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -2,7 +2,12 @@
import unittest
from test import test_support
+try:
+ import thread
+except ImportError:
+ thread = None
+@unittest.skipUnless(thread, 'threading not available')
class LockTests(unittest.TestCase):
"""Very basic test of import lock functions."""
@@ -68,13 +73,8 @@
def test_main():
tests = [
ReloadTests,
+ LockTests,
]
- try:
- import thread
- except ImportError:
- pass
- else:
- tests.append(LockTests)
test_support.run_unittest(*tests)
if __name__ == "__main__":