コード例 #1
0
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)
コード例 #2
0
ファイル: test_runner.py プロジェクト: appost/wnframework
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."
コード例 #3
0
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."