标签:parse unit unittest path static import get option adc
# 4. read_config.py import configparser class ReadConfig: @staticmethod def get_config(file_path, section, option): cf = configparser.ConfigParser() # 实例化一个对象 cf.read(file_path) # 读取配置文件 return cf[section][option] # 返回配置项 if __name__ == ‘__main__‘: from tools import project_path print(ReadConfig.get_config(project_path.case_config_path, "MODE", "mode"))
unittest(22)- p2p项目实战(4)-read_config
标签:parse unit unittest path static import get option adc
原文地址:https://www.cnblogs.com/come202011/p/12232191.html