diff --git a/Python的学习笔记(flora.chen).docx b/Python的学习笔记(flora.chen).docx index c1ca21a..503e0a7 100644 Binary files a/Python的学习笔记(flora.chen).docx and b/Python的学习笔记(flora.chen).docx differ diff --git a/python27HomeWork/unitTest/homeWork03122020/loginCaseData.xlsx b/python27HomeWork/unitTest/homeWork03122020/loginCaseData.xlsx index 0367e85..84314b4 100644 Binary files a/python27HomeWork/unitTest/homeWork03122020/loginCaseData.xlsx and b/python27HomeWork/unitTest/homeWork03122020/loginCaseData.xlsx differ diff --git a/python27HomeWork/unitTest/homeWork03122020/testLogin.py b/python27HomeWork/unitTest/homeWork03122020/testLogin.py index 1865f47..b9892b5 100644 --- a/python27HomeWork/unitTest/homeWork03122020/testLogin.py +++ b/python27HomeWork/unitTest/homeWork03122020/testLogin.py @@ -73,12 +73,15 @@ class TestLoginCase(unittest.TestCase): except AssertionError as e: result = 'Failed' # self.login_log.record_log_by_time_rotate().error('Test Case Failed, the reason is ' + str(e)) - self.log.error('Test Case Failed') + # self.log.error('Case Title = ' + case_data['title'] + ' result = ' + result) + self.log.error('Case Title = {} -- result = {}'.format(case_data['title'], result)) + # 专门用来将捕获到的异常记录到日志中(对应的等级是error) + self.log.exception(e) raise e # 用例通过,标记为Passed else: result = 'Passed' - self.log.info('Test Case Passed') + self.log.info('Case Title = {} -- result = {}'.format(case_data['title'], result)) # 不管通过与否,都将结果写回excel中 finally: self.excel.write_data(row, column, result)