def init_test(): print init()
import argparse import pytest import sys if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-k', '--keyword', help='只执行匹配关键字的用例,会匹配文件名、类名、方法名', type=str) parser.add_argument('-d', '--dir', help='指定要测试的目录', type=str) args = parser.parse_args() # 初始化 print '开始初始化......' init() print '初始化完成......' # 执行pytest前的参数准备 pytest_execute_params = [ '-c', 'config/pytest.ini', '-v', '--alluredir', 'output/' ] # 判断目录参数 dir = 'cases' if args.dir: dir = args.dir # 判断关键字参数 if args.keyword: pytest_execute_params.append('-k') pytest_execute_params.append(args.keyword)
#! /usr/bin/env python from init.init import init from loop.loop import loop from init.state import state_entire from postProc.postProcess import postProcess #Run the rest of the program if the initialization is sucessful. print "Anod Board UI program running..." state = state_entire().progState state = init() if (state == False): print "Erorr: main.py did not recieve state from init.py" else: dFile = loop(state) postProcess(dFile)