[Zope3-checkins] SVN: zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py Clarify the code. "if i:" is not something you want to see 96 lines down in a

Marius Gedminas marius at pov.lt
Fri Jul 13 07:30:14 EDT 2007


Log message for revision 77854:
  Clarify the code.  "if i:" is not something you want to see 96 lines down in a
  method.
  
  

Changed:
  U   zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py

-=-
Modified: zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py
===================================================================
--- zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py	2007-07-13 11:27:56 UTC (rev 77853)
+++ zope.testing/branches/output-refactoring/src/zope/testing/testrunner.py	2007-07-13 11:30:13 UTC (rev 77854)
@@ -845,9 +845,9 @@
             track = TrackRefs()
         rc = sys.gettotalrefcount()
 
-    for i in repeat_range:
+    for iteration in repeat_range:
         if repeat > 1:
-            output.info("Iteration %d" % (i+1))
+            output.info("Iteration %d" % (iteration + 1))
 
         if options.verbose > 0 or options.progress:
             output.info('  Running:')
@@ -915,7 +915,7 @@
             # TODO LATER: move the output into OutputFormatter
             if options.verbose:
                 track.update()
-                if i:
+                if iteration > 0:
                     print (" "
                            " sum detail refcount=%-8d"
                            " sys refcount=%-8d"
@@ -925,7 +925,7 @@
                         track.output()
                 else:
                     track.delta = None
-            elif i:
+            elif iteration > 0:
                 print "  sys refcount=%-8d change=%-6d" % (rc, rc - prev)
 
     return ran



More information about the Zope3-Checkins mailing list