Пример #1
0
 def test_func_report(self):
     obj = FinalStatus()
     obj.engine = EngineEmul()
     obj.parameters = BetterDict()
     log_recorder = RecordingHandler()
     obj.log.addHandler(log_recorder)
     obj.prepare()
     obj.aggregated_results(*self.__get_func_tree())
     obj.post_process()
     info_log = log_recorder.info_buff.getvalue()
     self.assertIn("Total: 3 tests", info_log)
     self.assertIn("Test TestClass.case2", info_log)
     self.assertIn("stacktrace2", info_log)
     self.assertIn("Test TestClass.case3", info_log)
     self.assertIn("stacktrace3", info_log)
     obj.log.removeHandler(log_recorder)
Пример #2
0
 def test_func_report(self):
     obj = FinalStatus()
     obj.engine = EngineEmul()
     obj.parameters = BetterDict()
     self.sniff_log(obj.log)
     obj.prepare()
     obj.aggregated_results(*self.__get_func_tree())
     obj.post_process()
     info_log = self.log_recorder.info_buff.getvalue()
     warn_log = self.log_recorder.warn_buff.getvalue()
     self.assertIn("Total: 3 tests", info_log)
     self.assertIn("Test TestClass.case2 failed: something broke", warn_log)
     self.assertIn("stacktrace2", warn_log)
     self.assertIn("Test TestClass.case3 failed: something is badly broken",
                   warn_log)
     self.assertIn("stacktrace3", warn_log)
Пример #3
0
 def test_func_report_all_no_stacktrace(self):
     obj = FinalStatus()
     obj.engine = EngineEmul()
     obj.parameters = BetterDict.from_dict({"report-tests": "all", "print-stacktrace": False})
     self.sniff_log(obj.log)
     obj.prepare()
     obj.startup()
     obj.shutdown()
     obj.aggregated_results(*self.__get_func_tree())
     obj.post_process()
     info_log = self.log_recorder.info_buff.getvalue()
     self.assertIn("Total: 3 tests", info_log)
     self.assertIn("Test TestClass.case1 - PASSED", info_log)
     self.assertIn("Test TestClass.case2 - FAILED", info_log)
     self.assertIn("Test TestClass.case3 - BROKEN", info_log)
     self.assertNotIn("stacktrace2", info_log)
     self.assertNotIn("stacktrace3", info_log)
Пример #4
0
 def test_func_report_all_no_stacktrace(self):
     obj = FinalStatus()
     obj.engine = EngineEmul()
     obj.parameters = BetterDict.from_dict({"report-tests": "all", "print-stacktrace": False})
     self.sniff_log(obj.log)
     obj.prepare()
     obj.startup()
     obj.shutdown()
     obj.aggregated_results(*self.__get_func_tree())
     obj.post_process()
     info_log = self.log_recorder.info_buff.getvalue()
     self.assertIn("Total: 3 tests", info_log)
     self.assertIn("Test TestClass.case1 - PASSED", info_log)
     self.assertIn("Test TestClass.case2 - FAILED", info_log)
     self.assertIn("Test TestClass.case3 - BROKEN", info_log)
     self.assertNotIn("stacktrace2", info_log)
     self.assertNotIn("stacktrace3", info_log)
Пример #5
0
 def test_func_report(self):
     obj = FinalStatus()
     obj.engine = EngineEmul()
     obj.parameters = BetterDict()
     self.sniff_log(obj.log)
     obj.prepare()
     obj.startup()
     obj.shutdown()
     obj.aggregated_results(*self.__get_func_tree())
     obj.post_process()
     info_log = self.log_recorder.info_buff.getvalue()
     warn_log = self.log_recorder.warn_buff.getvalue()
     self.assertIn("Total: 3 tests", info_log)
     self.assertIn("Test TestClass.case2 failed: something broke", warn_log)
     self.assertIn("stacktrace2", warn_log)
     self.assertIn("Test TestClass.case3 failed: something is badly broken", warn_log)
     self.assertIn("stacktrace3", warn_log)
Пример #6
0
 def test_func_report_all_no_stacktrace(self):
     obj = FinalStatus()
     obj.engine = EngineEmul()
     obj.parameters = BetterDict()
     log_recorder = RecordingHandler()
     obj.log.addHandler(log_recorder)
     obj.parameters.merge({"report-tests": "all", "print-stacktrace": False})
     obj.prepare()
     obj.aggregated_results(*self.__get_func_tree())
     obj.post_process()
     info_log = log_recorder.info_buff.getvalue()
     self.assertIn("Total: 3 tests", info_log)
     self.assertIn("Test TestClass.case1 - PASSED", info_log)
     self.assertIn("Test TestClass.case2 - FAILED", info_log)
     self.assertIn("Test TestClass.case3 - BROKEN", info_log)
     self.assertNotIn("stacktrace2", info_log)
     self.assertNotIn("stacktrace3", info_log)
     obj.log.removeHandler(log_recorder)