Show More
@@ -133,7 +133,7 b' def parselistfiles(files, listtype, warn' | |||||
133 | f.close() |
|
133 | f.close() | |
134 | return entries |
|
134 | return entries | |
135 |
|
135 | |||
136 |
def parse |
|
136 | def getparser(): | |
137 | parser = optparse.OptionParser("%prog [options] [tests]") |
|
137 | parser = optparse.OptionParser("%prog [options] [tests]") | |
138 |
|
138 | |||
139 | # keep these sorted |
|
139 | # keep these sorted | |
@@ -210,6 +210,10 b' def parseargs(args):' | |||||
210 | for option, (envvar, default) in defaults.items(): |
|
210 | for option, (envvar, default) in defaults.items(): | |
211 | defaults[option] = type(default)(os.environ.get(envvar, default)) |
|
211 | defaults[option] = type(default)(os.environ.get(envvar, default)) | |
212 | parser.set_defaults(**defaults) |
|
212 | parser.set_defaults(**defaults) | |
|
213 | ||||
|
214 | return parser | |||
|
215 | ||||
|
216 | def parseargs(args, parser): | |||
213 | (options, args) = parser.parse_args(args) |
|
217 | (options, args) = parser.parse_args(args) | |
214 |
|
218 | |||
215 | # jython is always pure |
|
219 | # jython is always pure | |
@@ -1176,8 +1180,9 b' def runtests(options, tests):' | |||||
1176 | testtypes = [('.py', pytest, '.out'), |
|
1180 | testtypes = [('.py', pytest, '.out'), | |
1177 | ('.t', tsttest, '')] |
|
1181 | ('.t', tsttest, '')] | |
1178 |
|
1182 | |||
1179 | def main(args): |
|
1183 | def main(args, parser=None): | |
1180 | (options, args) = parseargs(args) |
|
1184 | parser = parser or getparser() | |
|
1185 | (options, args) = parseargs(args, parser) | |||
1181 | os.umask(022) |
|
1186 | os.umask(022) | |
1182 |
|
1187 | |||
1183 | checktools() |
|
1188 | checktools() |
General Comments 0
You need to be logged in to leave comments.
Login now