def run_unittest(doctype, verbose=False): module = webnotes.conn.get_value("DocType", doctype, "module") test_module = get_module_name(doctype, module, "test_") make_test_records(doctype, verbose=verbose) test_suite = unittest.TestSuite() module = webnotes.get_module(test_module) test_suite.addTest(unittest.TestLoader().loadTestsFromModule(module)) return unittest.TextTestRunner(verbosity=1+(verbose and 1 or 0)).run(test_suite)
def run_unittest(doctype, verbose=False): module = webnotes.conn.get_value("DocType", doctype, "module") test_module = get_module_name(doctype, module, "test_") make_test_records(args.doctype[0], verbose=verbose) try: exec ('from %s import *' % test_module) in globals() del sys.argv[1:] unittest.main() except ImportError, e: print "No test module."
def run_unittest(doctype, verbose=False): module = webnotes.conn.get_value("DocType", doctype, "module") test_module = get_module_name(doctype, module, "test_") make_test_records(doctype, verbose=verbose) try: exec('from %s import *' % test_module) in globals() del sys.argv[1:] unittest.main() except ImportError, e: print "No test module."