diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-28 21:10:24 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-28 21:10:24 -0500 |
commit | b8b1aaed4d6eaeb8cab1afa2449863fe2bd91313 (patch) | |
tree | cd60550e2158fd3d731c28ad9ca51f0d1d3f78c5 /coverage/control.py | |
parent | 7cc3c763513ccdb6d6e783db668f742944495f43 (diff) | |
download | python-coveragepy-git-b8b1aaed4d6eaeb8cab1afa2449863fe2bd91313.tar.gz |
Read the data file from the COVERAGE_FILE environment variable.
--HG--
branch : config
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/coverage/control.py b/coverage/control.py index 77678543..eb134450 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -60,13 +60,23 @@ class coverage(object): """ from coverage import __version__ - # Build our configuration from a number of sources. + # Build our configuration from a number of sources: + # 1: defaults: self.config = CoverageConfig() + + # 2: from the coveragerc file: if config_file: if config_file is True: config_file = ".coveragerc" self.config.from_file(config_file) + + # 3: from environment variables: self.config.from_environment('COVERAGE_OPTIONS') + env_data_file = os.environ.get('COVERAGE_FILE') + if env_data_file: + self.config.data_file = env_data_file + + # 4: from constructor arguments: self.config.from_args( data_file=data_file, cover_pylib=cover_pylib, timid=timid, branch=branch |