Commits

Ned Batchelder  committed ad67a86

Clarify when coverage measurement actually starts. #102

  • Participants
  • Parent commits 776178b

Comments (0)

Files changed (2)

File coverage/control.py

 
         cov = coverage()
         cov.start()
-        #.. blah blah (run your code) blah blah ..
+        #.. call your code ..
         cov.stop()
         cov.html_report(directory='covhtml')
 
         self.data.read()
 
     def start(self):
-        """Start measuring code coverage."""
+        """Start measuring code coverage.
+
+        Coverage measurement actually occurs in functions called after `start`
+        is invoked.  Statements in the same scope as `start` won't be measured.
+
+        """
         if self.run_suffix:
             # Calling start() means we're running code, so use the run_suffix
             # as the data_suffix when we eventually save the data.
 :history: 20090613T164000, final touches for 3.0
 :history: 20100221T151500, docs for 3.3 (on the plane back from PyCon)
 :history: 20100725T211700, updated for 3.4.
+:history: 20121111T235800, added a bit of clarification.
 
 
 The API to coverage.py is very simple, contained in a single module called
     cov = coverage.coverage()
     cov.start()
 
-    # .. run your code ..
+    # .. call your code ..
 
     cov.stop()
     cov.save()
 
+    cov.html_report()
+
 
 The coverage module
 -------------------