From 13765fe075fd9c7075b130f76317972da87f2b9b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 12 Nov 2012 00:01:59 -0500 Subject: Clarify when coverage measurement actually starts. #102 --- coverage/control.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 20afff5e..6f15bf9d 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -25,7 +25,7 @@ class coverage(object): cov = coverage() cov.start() - #.. blah blah (run your code) blah blah .. + #.. call your code .. cov.stop() cov.html_report(directory='covhtml') @@ -320,7 +320,12 @@ class coverage(object): 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. -- cgit v1.2.1