summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/cmdline.py6
-rw-r--r--doc/cmd.rst3
-rw-r--r--tests/test_cmdline.py2
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):