2008-08-16 23:26:59 +08:00
|
|
|
import py
|
2009-08-29 01:16:15 +08:00
|
|
|
import sys
|
2008-08-16 23:26:59 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# main entry point
|
|
|
|
#
|
|
|
|
|
|
|
|
def main(args=None):
|
|
|
|
if args is None:
|
2009-08-29 01:16:15 +08:00
|
|
|
args = sys.argv[1:]
|
2008-08-16 23:26:59 +08:00
|
|
|
config = py.test.config
|
2009-03-17 15:03:49 +08:00
|
|
|
try:
|
|
|
|
config.parse(args)
|
2009-04-09 22:03:09 +08:00
|
|
|
config.pluginmanager.do_configure(config)
|
2009-03-17 15:03:49 +08:00
|
|
|
session = config.initsession()
|
|
|
|
exitstatus = session.main()
|
2009-04-09 22:03:09 +08:00
|
|
|
config.pluginmanager.do_unconfigure(config)
|
2009-03-17 15:03:49 +08:00
|
|
|
raise SystemExit(exitstatus)
|
2009-08-29 01:16:15 +08:00
|
|
|
except config.Error:
|
|
|
|
e = sys.exc_info()[1]
|
|
|
|
sys.stderr.write("ERROR: %s\n" %(e.args[0],))
|
2009-03-17 15:03:49 +08:00
|
|
|
raise SystemExit(3)
|
2008-08-16 23:26:59 +08:00
|
|
|
|