summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-08-25 19:25:03 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-08-26 10:37:07 -0400
commit8295f50fa3dfebb12b94f9745385a3227ec7d53c (patch)
tree3c1cc598b0817bf5c1773fd237db8e81d05bd12a
parent15618a42862eac786fd21e02943600899cd5c0af (diff)
downloadpython-coveragepy-git-8295f50fa3dfebb12b94f9745385a3227ec7d53c.tar.gz
Better sys_info: pid, and a more understandable name.
-rw-r--r--coverage/control.py5
-rw-r--r--tests/test_cmdline.py2
-rw-r--r--tests/test_debug.py4
3 files changed, 6 insertions, 5 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 6329441f..37ebada6 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -846,17 +846,18 @@ class Coverage(object):
('configs_attempted', self.config.attempted_config_files),
('configs_read', self.config.config_files_read),
('config_file', self.config.config_file),
- ('data_path', self._data.filename if self._data else "-none-"),
+ ('data_file', self._data.filename if self._data else "-none-"),
('python', sys.version.replace('\n', '')),
('platform', platform.platform()),
('implementation', platform.python_implementation()),
('executable', sys.executable),
+ ('pid', os.getpid()),
('cwd', os.getcwd()),
('path', sys.path),
('environment', sorted(
("%s = %s" % (k, v))
for k, v in iitems(os.environ)
- if k.startswith(("COV", "PY"))
+ if any(slug in k for slug in ("COV", "PY"))
)),
('command_line', " ".join(getattr(sys, 'argv', ['???']))),
]
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index b12f92ea..a4d01880 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -232,7 +232,7 @@ class CmdLineTest(BaseCmdLineTest):
self.command_line("debug sys")
out = self.stdout()
self.assertIn("version:", out)
- self.assertIn("data_path:", out)
+ self.assertIn("data_file:", out)
def test_debug_config(self):
self.command_line("debug config")
diff --git a/tests/test_debug.py b/tests/test_debug.py
index c47dd343..26ddc0df 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -168,8 +168,8 @@ class DebugTraceTest(CoverageTest):
labels = """
version coverage cover_paths pylib_paths tracer configs_attempted config_file
- configs_read data_path python platform implementation executable
- cwd path environment command_line cover_match pylib_match
+ configs_read data_file python platform implementation executable
+ pid cwd path environment command_line cover_match pylib_match
""".split()
for label in labels:
label_pat = r"^\s*%s: " % label