summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imp.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-05-03 14:56:19 (GMT)
committerBrett Cannon <brett@python.org>2013-05-03 14:56:19 (GMT)
commit142685337f2eab63ac85d2e9a284a5eb900cd053 (patch)
tree4152adcc3dcc6c3598c774012c523bcabd78029e /Lib/test/test_imp.py
parent130e48199a28239c0574f233c6e20fbe6a41d1cd (diff)
downloadcpython-142685337f2eab63ac85d2e9a284a5eb900cd053.zip
cpython-142685337f2eab63ac85d2e9a284a5eb900cd053.tar.gz
cpython-142685337f2eab63ac85d2e9a284a5eb900cd053.tar.bz2
Move test_imp over to unittest.main()
Diffstat (limited to 'Lib/test/test_imp.py')
-rw-r--r--Lib/test/test_imp.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index f9b87bb..1cd7c8a 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -1,3 +1,7 @@
+try:
+ import _thread
+except ImportError:
+ _thread = None
import imp
import importlib
import os
@@ -17,6 +21,7 @@ def requires_load_dynamic(meth):
'imp.load_dynamic() required')(meth)
+@unittest.skipIf(_thread is None, '_thread module is required')
class LockTests(unittest.TestCase):
"""Very basic test of import lock functions."""
@@ -446,20 +451,5 @@ class NullImporterTests(unittest.TestCase):
os.rmdir(name)
-def test_main():
- tests = [
- ImportTests,
- PEP3147Tests,
- ReloadTests,
- NullImporterTests,
- ]
- try:
- import _thread
- except ImportError:
- pass
- else:
- tests.append(LockTests)
- support.run_unittest(*tests)
-
if __name__ == "__main__":
- test_main()
+ unittest.main() \ No newline at end of file