summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuichi Ito <ito.yuichi0@gmail.com>2014-05-16 04:40:43 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-05-16 04:40:43 +0900
commitca1b2717052cc895f5bc7fbce896c077f18d80bf (patch)
treeb568b5b517bcc4cb480c5facae3c2f0f50a7d4f3
parent200241a66d4a1f062436fec66b6cecf65aad4638 (diff)
tester: cleanup the code of couting the results
Reported-by: Chiu,Cheng-Han <a54931232@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/switch/tester.py6
1 files 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,