about summary refs log tree commit diff stats
path: root/all_tests.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-12 00:23:18 +0100
committerhut <hut@lavabit.com>2009-12-12 00:23:18 +0100
commit22449efdeaec4ae089a6461ab93700536b5ea1bd (patch)
treee50ea0bcd38f93bd3fa59f60086980f84e33282f /all_tests.py
parent649a69cb87af38f4bf1848085d49d1193f6e01ab (diff)
downloadranger-22449efdeaec4ae089a6461ab93700536b5ea1bd.tar.gz
clean ups/fixes
Diffstat (limited to 'all_tests.py')
-rwxr-xr-xall_tests.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/all_tests.py b/all_tests.py
index b408b5de..dde73d53 100755
--- a/all_tests.py
+++ b/all_tests.py
@@ -1,11 +1,13 @@
 #!/usr/bin/python3
-import unittest
-from test import *
+"""Run all the tests inside the test/ directory as a test suite."""
+if __name__ == '__main__':
+	import unittest
+	from test import *
 
-tests = []
-for key, val in vars().copy().items():
-	if key.startswith('tc_'):
-		tests.extend(v for k,v in vars(val).items() if type(v) == type)
+	tests = []
+	for key, val in vars().copy().items():
+		if key.startswith('tc_'):
+			tests.extend(v for k,v in vars(val).items() if type(v) == type)
 
-suite = unittest.TestSuite(map(unittest.makeSuite, tests))
-unittest.TextTestRunner(verbosity=2).run(suite)
+	suite = unittest.TestSuite(map(unittest.makeSuite, tests))
+	unittest.TextTestRunner(verbosity=2).run(suite)