On Wed, 14 May 2014 21:48:18 +0900
Chiu,Cheng-Han <[email protected]> wrote:

> From: "Chiu,Cheng-Han" <[email protected]>
> 
> Signed-off-by: Chiu,Cheng-Han <[email protected]>
> ---
>  ryu/tests/switch/tester.py |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py
> index a6734ce..499f8ff 100644
> --- a/ryu/tests/switch/tester.py
> +++ b/ryu/tests/switch/tester.py
> @@ -480,7 +480,7 @@ class OfTester(app_manager.RyuApp):
>          for result_type in sorted(report.keys()):
>              test_descriptions = report[result_type]
>              if result_type == TEST_OK:
> -                ok_count = len(test_descriptions)
> +                ok_count += len(test_descriptions)
>                  continue
>              error_count += len(test_descriptions)
>              self.logger.info('%s(%d)', result_type, len(test_descriptions))
> 

Thank you for sending a patch.

Well, I think there's no need to calculate ok_count in the loop.
(ok_count is assigned only when result_type is TEST_OK.)

How about this?


diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py
index a6734ce..813d18a 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,

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to