summaryrefslogtreecommitdiff
path: root/tests/generate.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generate.py')
-rw-r--r--tests/generate.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/generate.py b/tests/generate.py
index 587efb519..5d1a8e66d 100644
--- a/tests/generate.py
+++ b/tests/generate.py
@@ -8,7 +8,7 @@
from __future__ import with_statement
from string import Template
-import re, fnmatch, os, codecs, pickle
+import re, fnmatch, os, sys, codecs, pickle
class Module(object):
class Template(object):
@@ -234,11 +234,14 @@ if __name__ == '__main__':
parser.add_option('-x', '--exclude', dest='excluded', action='append', default=[])
options, args = parser.parse_args()
-
- for path in args or ['.']:
- suite = TestSuite(path)
- suite.load(options.force)
- suite.disable(options.excluded)
- if suite.write():
- print("Written `clar.suite` (%d tests in %d suites)" % (suite.callback_count(), suite.suite_count()))
+ if len(args) > 1:
+ print("More than one path given")
+ sys.exit(1)
+
+ path = args.pop() if args else '.'
+ suite = TestSuite(path)
+ suite.load(options.force)
+ suite.disable(options.excluded)
+ if suite.write():
+ print("Written `clar.suite` (%d tests in %d suites)" % (suite.callback_count(), suite.suite_count()))