Fixed bug in argument handling

This commit is contained in:
Jeremy Fincher 2003-04-03 07:11:39 +00:00
parent 073188eb25
commit 6b4636e8ae

View File

@ -42,10 +42,10 @@ import unittest
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) > 1: if len(sys.argv) > 1:
names = sys.argv[1:] files = sys.argv[1:]
else: else:
files = glob.glob(os.path.join('test', '*_test.py')) files = glob.glob(os.path.join('test', '*_test.py'))
names = [os.path.splitext(os.path.basename(file))[0] for file in files] names = [os.path.splitext(os.path.basename(file))[0] for file in files]
suite = unittest.defaultTestLoader.loadTestsFromNames(names) suite = unittest.defaultTestLoader.loadTestsFromNames(names)
runner = unittest.TextTestRunner(verbosity=1) runner = unittest.TextTestRunner(verbosity=1)
runner.run(suite) runner.run(suite)