From 6451321ebefa3e3976f78d4b10298a200b91aecc Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 12 May 2009 20:39:04 -0400 Subject: cover_stdlib wasn't quite right, it controls covering the entire Python library, so cover_pylib it is. --- coverage/control.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 03837362..32e6fad3 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -14,7 +14,7 @@ class coverage: """Programmatic access to Coverage. """ - def __init__(self, data_file=None, data_suffix=False, cover_stdlib=False): + def __init__(self, data_file=None, data_suffix=False, cover_pylib=False): """Create a new coverage measurement context. `data_file` is the base name of the data file to use, defaulting to @@ -22,14 +22,15 @@ class coverage: final file name. If `data_suffix` is simply True, then a suffix is created with the machine and process identity included. - `cover_stdlib` is a boolean determining whether Python code installed - with the Python interpreter is measured. + `cover_pylib` is a boolean determining whether Python code installed + with the Python interpreter is measured. This includes the Python + standard library and any packages installed with the interpreter. """ from coverage.collector import Collector from coverage import __version__ - self.cover_stdlib = cover_stdlib + self.cover_pylib = cover_pylib self.exclude_re = "" self.exclude_list = [] @@ -80,9 +81,9 @@ class coverage: canonical = self.file_locator.canonical_filename(filename) - # If we aren't supposed to trace the stdlib, then check if this is in - # the stdlib and skip it if so. - if not self.cover_stdlib: + # If we aren't supposed to trace installed code, then check if this is + # near the Python interpreter and skip it if so. + if not self.cover_pylib: if canonical.startswith(self.sysprefix): return False -- cgit v1.2.1