From ca1b2717052cc895f5bc7fbce896c077f18d80bf Mon Sep 17 00:00:00 2001 From: Yuichi Ito Date: Fri, 16 May 2014 04:40:43 +0900 Subject: tester: cleanup the code of couting the results Reported-by: Chiu,Cheng-Han Signed-off-by: FUJITA Tomonori --- ryu/tests/switch/tester.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py index 00fac59c..c3830fc1 100644 --- a/ryu/tests/switch/tester.py +++ b/ryu/tests/switch/tester.py @@ -476,18 +476,18 @@ class OfTester(app_manager.RyuApp): def _output_test_report(self, report): self.logger.info('%s--- Test report ---', os.linesep) - ok_count = error_count = 0 + error_count = 0 for result_type in sorted(report.keys()): test_descriptions = report[result_type] if result_type == TEST_OK: - ok_count = len(test_descriptions) continue error_count += len(test_descriptions) self.logger.info('%s(%d)', result_type, len(test_descriptions)) for file_desc, test_desc in test_descriptions: self.logger.info(' %-40s %s', file_desc, test_desc) self.logger.info('%s%s(%d) / %s(%d)', os.linesep, - TEST_OK, ok_count, TEST_ERROR, error_count) + TEST_OK, len(report.get(TEST_OK, [])), + TEST_ERROR, error_count) def _test(self, state, *args): test = {STATE_INIT_FLOW: self._test_initialize_flow, -- cgit v1.2.3