From f346f85e04e44294e4c26f876e8dc75b17c4f8d7 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 4 Jul 2014 22:15:20 -0400 Subject: Crazy-ugly start to extensions for Django and Mako --HG-- branch : django --- coverage/config.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'coverage/config.py') diff --git a/coverage/config.py b/coverage/config.py index 372439a6..e5e35856 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -122,6 +122,7 @@ class CoverageConfig(object): self.timid = False self.source = None self.debug = [] + self.extensions = [] # Defaults for [report] self.exclude_list = DEFAULT_EXCLUDE[:] @@ -153,7 +154,7 @@ class CoverageConfig(object): if env: self.timid = ('--timid' in env) - MUST_BE_LIST = ["omit", "include", "debug"] + MUST_BE_LIST = ["omit", "include", "debug", "extensions"] def from_args(self, **kwargs): """Read config values from `kwargs`.""" @@ -185,12 +186,21 @@ class CoverageConfig(object): self.paths[option] = cp.getlist('paths', option) CONFIG_FILE_OPTIONS = [ + # These are *args for set_attr_from_config_option: + # (attr, where, type_="") + # + # attr is the attribute to set on the CoverageConfig object. + # where is the section:name to read from the configuration file. + # type_ is the optional type to apply, by using .getTYPE to read the + # configuration value from the file. + # [run] ('branch', 'run:branch', 'boolean'), ('coroutine', 'run:coroutine'), ('cover_pylib', 'run:cover_pylib', 'boolean'), ('data_file', 'run:data_file'), ('debug', 'run:debug', 'list'), + ('extensions', 'run:extensions', 'list'), ('include', 'run:include', 'list'), ('omit', 'run:omit', 'list'), ('parallel', 'run:parallel', 'boolean'), -- cgit v1.2.1