diff options
author | Matthew Boehm <boehm.matthew@gmail.com> | 2016-06-02 18:04:45 -0400 |
---|---|---|
committer | Matthew Boehm <boehm.matthew@gmail.com> | 2016-06-02 18:04:45 -0400 |
commit | 0b5ceb5ce9fa3c2b31242bc533338ff2038f80f1 (patch) | |
tree | af1f267cb0789c3cc7f64cc3c6088657f28fb0ac | |
parent | 0f4b897d4b637abafb8efb5607a8285587429fd9 (diff) | |
download | python-coveragepy-git-0b5ceb5ce9fa3c2b31242bc533338ff2038f80f1.tar.gz |
Add support for `coverage debug config`
Previously, coverage --debug=config worked, but `coverage debug config` didn't.
Fixes #454
-rw-r--r-- | coverage/cmdline.py | 7 | ||||
-rw-r--r-- | tests/test_cmdline.py | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 508a4395..fdf1c3d5 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -641,7 +641,7 @@ class CoverageScript(object): """Implementation of 'coverage debug'.""" if not args: - self.help_fn("What information would you like: data, sys?") + self.help_fn("What information would you like: config, data, sys?") return ERR for info in args: @@ -668,6 +668,11 @@ class CoverageScript(object): print(line) else: print("No data collected") + elif info == 'config': + print(info_header("config")) + config_info = self.coverage.config.__dict__.items() + for line in info_formatter(config_info): + print(" %s" % line) else: self.help_fn("Don't know what you mean by %r" % info) return ERR diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index ee60ed46..8e2840b4 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -218,7 +218,7 @@ class CmdLineTest(BaseCmdLineTest): """) def test_debug(self): - self.cmd_help("debug", "What information would you like: data, sys?") + self.cmd_help("debug", "What information would you like: config, data, sys?") self.cmd_help("debug foo", "Don't know what you mean by 'foo'") def test_debug_sys(self): @@ -227,6 +227,12 @@ class CmdLineTest(BaseCmdLineTest): self.assertIn("version:", out) self.assertIn("data_path:", out) + def test_debug_config(self): + self.command_line("debug config") + out = self.stdout() + self.assertIn("cover_pylib:", out) + self.assertIn("skip_covered:", out) + def test_erase(self): # coverage erase self.cmd_executes("erase", """\ |