summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-09 11:01:34 +0200
committerhut <hut@lavabit.com>2010-06-09 11:43:26 +0200
commit244fc3497a6902298d10ac82be9c6e0cb68c2011 (patch)
treef000fb44ed1e1ba1494671477d6deac89efaa810
parent8c275ccfa881998d96bdb5c1585118882630254b (diff)
downloadranger-244fc3497a6902298d10ac82be9c6e0cb68c2011.tar.gz
all_tests.py: cleanup
-rwxr-xr-xtest/all_tests.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/all_tests.py b/test/all_tests.py
index 04321462..7cfc855f 100755
--- a/test/all_tests.py
+++ b/test/all_tests.py
@@ -14,20 +14,20 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-"""Run all the tests inside the test/ directory as a test suite."""
-if __name__ == '__main__':
-	import unittest
-	import sys
-	import os
+"""
+Run all the tests inside this directory as a test suite.
+Usage: ./all_tests.py [verbosity]
+"""
 
-	try:
-		verbosity = int(sys.argv[1])
-	except IndexError:
-		verbosity = 2
+import os
+import sys
+import unittest
 
-	ls = os.listdir(sys.path[0])
-	paths = [p[:-3] for p in ls if p[:3] == 'tc_' and p[-3:] == '.py']
-	suite = unittest.TestLoader().loadTestsFromNames(paths)
-	result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
-	if len(result.errors) + len(result.failures) > 0:
+if __name__ == '__main__':
+	verbosity = int(sys.argv[1]) if len(sys.argv) > 1 else 1
+	tests     = (fname[:-3] for fname in os.listdir(sys.path[0]) \
+	             if fname[:3] == 'tc_' and fname[-3:] == '.py')
+	suite     = unittest.TestLoader().loadTestsFromNames(tests)
+	result    = unittest.TextTestRunner(verbosity=verbosity).run(suite)
+	if len(result.errors + result.failures) > 0:
 		sys.exit(1)
Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/env python
# Copyright (C) 2009, 2010, 2011  Roman Zimbelmann <romanz@lavabit.com>
# This software is distributed under the terms of the GNU GPL version 3.

import distutils.core
import ranger

if __name__ == '__main__':
	distutils.core.setup(
		name='ranger',
		description='Vim-like file manager',
		long_description=ranger.__doc__,
		version=ranger.__version__,
		author=ranger.__author__,
		author_email=ranger.__email__,
		license=ranger.__license__,
		url='http://savannah.nongnu.org/projects/ranger',
		scripts=['ranger/data/ranger'],
		data_files=[('share/man/man1', ['doc/ranger.1'])],
		package_data={'ranger': ['data/*', 'defaults/rc.conf',
			'defaults/rifle.conf']},
		packages=('ranger',
		          'ranger.api',
		          'ranger.colorschemes',
		          'ranger.container',
		          'ranger.core',
		          'ranger.defaults',
		          'ranger.ext',
		          'ranger.fsobject',
		          'ranger.gui',
		          'ranger.gui.widgets'))