Commit beea10973b9fb88ea89f098fcfda6ac648d2b2ed

Authored by liujiqiang
1 parent 19236b73

配置文件优化

commons/readConf.py
... ... @@ -20,16 +20,19 @@ class readConfig(object):
20 20 self.conf = configparser.ConfigParser()
21 21 self.evn_name = os.name
22 22 self.file_name = r'test_config_hg'
23   - if self.evn_name == 'nt':
24   - self.relative_path = r'/config/marketConfig/'
25   - # # 本地调试路径
26   - # self.file_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) + self.relative_path+self.file_name
27   - # 本地main方法执行路径
28   - self.file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../")) + self.relative_path + self.file_name
29   - elif self.evn_name == 'posix':
30   - self.relative_path = r'/config/marketConfig/'
31   - self.file_path = os.path.abspath(os.path.join(os.getcwd())) + self.relative_path + self.file_name
32   - # self.file_path = os.getcwd()
  23 + # if self.evn_name == 'nt':
  24 + # self.relative_path = r'/config/marketConfig/'
  25 + # # # 本地调试路径
  26 + # # self.file_path = os.path.abspath(os.path.join(os.getcwd(), "../..")) + self.relative_path+self.file_name
  27 + # # 本地main方法执行路径
  28 + # self.file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../")) + self.relative_path + self.file_name
  29 + # elif self.evn_name == 'posix':
  30 + # self.relative_path = r'/config/marketConfig/'
  31 + # self.file_path = os.path.abspath(os.path.join(os.getcwd())) + self.relative_path + self.file_name
  32 + # # self.file_path = os.getcwd()
  33 + self.relative_path = r'/config/marketConfig/'
  34 + self.file_path = os.path.abspath(
  35 + os.path.join(os.path.dirname(__file__), "../")) + self.relative_path + self.file_name
33 36 print(self.file_path)
34 37 self.conf.read(self.file_path,encoding="utf-8")
35 38  
... ...
report/test.log
1   -[2021-07-20 11:16:24] [INFO] : 发送邮件
2   -[2021-07-20 11:16:27] [INFO] : 邮件发送完毕
testCase/main.py
... ... @@ -50,7 +50,7 @@ def Run_Testcase(testsuit):
50 50 runner.run(testsuit)
51 51 # 关闭文件
52 52 fp.close()
53   - delReport.delReport(path)
  53 + # delReport.delReport(path)
54 54 return report_file
55 55  
56 56  
... ...