@click.command(u'run-tests')
@click.option(u'--app', help=u'For App')
@click.option(u'--doctype', help=u'For DocType')
@click.option(u'--test', multiple=True, help=u'Specific test')
@click.option(u'--driver', help=u'For Travis')
@click.option(u'--module', help=u'Run tests in a module')
@click.option(u'--profile', is_flag=True, default=False)
@click.option(u'--junit-xml-output', help=u'Destination file path for junit xml report')
@pass_context
def run_tests(context, app=None, module=None, doctype=None, test=(), driver=None, profile=False, junit_xml_output=False):
 import frappe.test_runner
 from frappe.utils import sel
 tests = test
 site = get_site(context)
 frappe.init(site=site)
 if (frappe.conf.run_selenium_tests and False):
  sel.start(context.verbose, driver)
 try:
  ret = frappe.test_runner.main(app, module, doctype, context.verbose, tests=tests, force=context.force, profile=profile, junit_xml_output=junit_xml_output)
  if ((len(ret.failures) == 0) and (len(ret.errors) == 0)):
   ret = 0
 finally:
  pass
  if frappe.conf.run_selenium_tests:
   sel.close()
 sys.exit(ret)

@ click . command ( u'run-tests' ) @ click . option ( u'--app' , help = u'For App' ) @ click . option ( u'--doctype' , help = u'For DocType' ) @ click . option ( u'--test' , multiple = True , help = u'Specific test' ) @ click . option ( u'--driver' , help = u'For Travis' ) @ click . option ( u'--module' , help = u'Run tests in a module' ) @ click . option ( u'--profile' , is_flag = True , default = False ) @ click . option ( u'--junit-xml-output' , help = u'Destination file path for junit xml report' ) @ pass_context def run_tests ( context , app = None , module = None , doctype = None , test = ( ) , driver = None , profile = False , junit_xml_output = False ) : import frappe . test_runner from frappe . utils import sel tests = test site = get_site ( context ) frappe . init ( site = site ) if ( frappe . conf . run_selenium_tests and False ) : sel . start ( context . verbose , driver ) try : ret = frappe . test_runner . main ( app , module , doctype , context . verbose , tests = tests , force = context . force , profile = profile , junit_xml_output = junit_xml_output ) if ( ( len ( ret . failures ) == 0 ) and ( len ( ret . errors ) == 0 ) ) : ret = 0 finally : pass if frappe . conf . run_selenium_tests : sel . close ( ) sys . exit ( ret )
args - xmloutput [str or none] path of xml output directory - verbosity [int] verbosity level of tests output returns the testresult object after running the test *suite* .