diff options
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/cmdline.py | 6 | ||||
-rw-r--r-- | coverage/control.py | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 2ccd54f5..fd6101b6 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -13,7 +13,7 @@ coverage -x [-p] [-L] MODULE.py [ARG1 ARG2 ...] Execute the module, passing the given command-line arguments, collecting coverage data. With the -p option, include the machine name and process ID in the .coverage file name. With -L, measure coverage even inside the - Python standard library, which isn't done by default. + Python installed library, which isn't done by default. coverage -e Erase collected coverage data. @@ -87,7 +87,7 @@ class CoverageScript: '-e': 'erase', '-h': 'help', '-i': 'ignore-errors', - '-L': 'stdlib', + '-L': 'pylib', '-m': 'show-missing', '-p': 'parallel-mode', '-r': 'report', @@ -138,7 +138,7 @@ class CoverageScript: # Do something. self.coverage = self.covpkg.coverage( data_suffix = bool(settings.get('parallel-mode')), - cover_stdlib = settings.get('stdlib') + cover_pylib = settings.get('pylib') ) if settings.get('erase'): 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 |