summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-12-02 12:39:20 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-12-02 12:39:20 -0500
commit67e4df6c341e3e4e7eaa7ca33bbc236b62ea177c (patch)
tree3c3a6e7335b3c2c1302d0fff8e0296c0480c70a7
parente8d329fb092e644e726578ebc3d6167c84d30914 (diff)
downloadpython-coveragepy-git-67e4df6c341e3e4e7eaa7ca33bbc236b62ea177c.tar.gz
debug sys shows the config files attempted, and the config files read.
-rw-r--r--coverage/config.py9
-rw-r--r--coverage/control.py3
2 files changed, 8 insertions, 4 deletions
diff --git a/coverage/config.py b/coverage/config.py
index d8c40d28..c2ebecb2 100644
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -18,7 +18,7 @@ class HandyConfigParser(configparser.RawConfigParser):
kwargs = {}
if sys.version_info >= (3, 2):
kwargs['encoding'] = "utf-8"
- configparser.RawConfigParser.read(self, filename, **kwargs)
+ return configparser.RawConfigParser.read(self, filename, **kwargs)
def get(self, *args, **kwargs):
v = configparser.RawConfigParser.get(self, *args, **kwargs)
@@ -101,6 +101,7 @@ class CoverageConfig(object):
def __init__(self):
"""Initialize the configuration attributes to their defaults."""
# Metadata about the config.
+ self.attempted_config_files = []
self.config_files = []
# Defaults for [run]
@@ -157,10 +158,12 @@ class CoverageConfig(object):
`filename` is a file name to read.
"""
- self.config_files.append(filename)
+ self.attempted_config_files.append(filename)
cp = HandyConfigParser()
- cp.read(filename)
+ files_read = cp.read(filename)
+ if files_read is not None: # return value changed in 2.4
+ self.config_files.extend(files_read)
for option_spec in self.CONFIG_FILE_OPTIONS:
self.set_attr_from_config_option(cp, *option_spec)
diff --git a/coverage/control.py b/coverage/control.py
index 4312f68c..c7c6950a 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -656,7 +656,8 @@ class coverage(object):
('cover_dir', self.cover_dir),
('pylib_dirs', self.pylib_dirs),
('tracer', self.collector.tracer_name()),
- ('config_files', self.config.config_files),
+ ('config_files', self.config.attempted_config_files),
+ ('configs_read', self.config.config_files),
('data_path', self.data.filename),
('python', sys.version.replace('\n', '')),
('platform', platform.platform()),