# 2021.6.22, #294, 修复小错误
def test_without_dir(self):
for h in log.handlers:
h.close()
shutil.rmtree(self.log_path)
set_log_file(self.log_filename)
assert os.path.exists(self.log_path)
test_project.py
# 2021.6.22, #294, 修复小错误
def test_load_bad_01(self):
"""
empty file
"""
base_dir = os.path.dirname(os.path.abspath(__file__))
target_file = base_dir + os.sep + 'test_project_with_empty_file.yaml'
with open(target_file, 'wb') as f:
f.close()
with pytest.raises(KeyError) as e:
init_project_by_yml(target_file, '.')
exec_msg = e.value.args[0]
assert exec_msg == 'project config format Error: fail to load'
# os.remove(target_file)
windows下ut会报两个错误,关于文件被其他程序打开。
修改如下
test_logger.py
test_project.py