diff options
Diffstat (limited to 'coverage/config.py')
-rw-r--r-- | coverage/config.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/coverage/config.py b/coverage/config.py index ad3efa91..287844b8 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -368,7 +368,6 @@ class CoverageConfig(object): Returns the value of the option. """ - # Check all the hard-coded options. for option_spec in self.CONFIG_FILE_OPTIONS: attr, where = option_spec[:2] @@ -383,6 +382,11 @@ class CoverageConfig(object): # If we get here, we didn't find the option. raise CoverageException("No such option: %r" % option_name) + def sanity_check(self): + """Check interactions among settings, and raise if there's a problem.""" + if (self.source is not None) and (self.include is not None): + raise CoverageException("--include and --source are mutually exclusive") + def read_coverage_config(config_file, **kwargs): """Read the coverage.py configuration. @@ -439,4 +443,6 @@ def read_coverage_config(config_file, **kwargs): # 4) from constructor arguments: config.from_args(**kwargs) + config.sanity_check() + return config_file, config |