diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2020-01-09 06:53:45 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2020-01-11 07:15:04 -0500 |
commit | 1c653dd10d3b75b9b442981139bc8e796aea148c (patch) | |
tree | 9ab4d9fd7f286f6b4d772a3ea210e7fe740926a6 | |
parent | d10e03c4347198f6f04cf31103cee53cd02f2ee0 (diff) | |
download | python-coveragepy-git-1c653dd10d3b75b9b442981139bc8e796aea148c.tar.gz |
"coverage debug premain"
-rw-r--r-- | coverage/cmdline.py | 6 | ||||
-rw-r--r-- | doc/cmd.rst | 3 | ||||
-rw-r--r-- | tests/test_cmdline.py | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 47a1601b..57266e73 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -715,7 +715,7 @@ class CoverageScript(object): """Implementation of 'coverage debug'.""" if not args: - show_help("What information would you like: config, data, sys?") + show_help("What information would you like: config, data, sys, premain?") return ERR for info in args: @@ -747,6 +747,10 @@ class CoverageScript(object): config_info = self.coverage.config.__dict__.items() for line in info_formatter(config_info): print(" %s" % line) + elif info == "premain": + print(info_header("premain")) + from coverage.debug import short_stack + print(short_stack()) else: show_help("Don't know what you mean by %r" % info) return ERR diff --git a/doc/cmd.rst b/doc/cmd.rst index 3933c567..cbbb26bb 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -498,8 +498,9 @@ command can often help:: Three types of information are available: * ``config``: show coverage's configuration -* ``sys``: show system configuration, +* ``sys``: show system configuration * ``data``: show a summary of the collected coverage data +* ``premain``: show the call stack invoking coverage .. _cmd_run_debug: diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 666327c8..f5e8e96a 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -248,7 +248,7 @@ class CmdLineTest(BaseCmdLineTest): """) def test_debug(self): - self.cmd_help("debug", "What information would you like: config, data, sys?") + self.cmd_help("debug", "What information would you like: config, data, sys, premain?") self.cmd_help("debug foo", "Don't know what you mean by 'foo'") def test_debug_sys(self): |