Include py version in the terminal output

This can help to reproduce bugs when looking at the output pasted into
bug reports.
This commit is contained in:
Floris Bruynooghe 2014-01-22 11:27:15 +01:00
parent 1ffc006363
commit e12fe64b54
2 changed files with 4 additions and 3 deletions

View File

@ -259,7 +259,7 @@ class TerminalReporter:
if hasattr(sys, 'pypy_version_info'):
verinfo = ".".join(map(str, sys.pypy_version_info[:3]))
msg += "[pypy-%s-%s]" % (verinfo, sys.pypy_version_info[3])
msg += " -- pytest-%s" % (pytest.__version__)
msg += " -- py-%s -- pytest-%s" % (py.__version__, pytest.__version__)
if self.verbosity > 0 or self.config.option.debug or \
getattr(self.config.option, 'pastebin', None):
msg += " -- " + str(sys.executable)

View File

@ -408,8 +408,9 @@ class TestTerminalFunctional:
verinfo = ".".join(map(str, py.std.sys.version_info[:3]))
result.stdout.fnmatch_lines([
"*===== test session starts ====*",
"platform %s -- Python %s*" % (
py.std.sys.platform, verinfo), # , py.std.sys.executable),
"platform %s -- Python %s* -- py-%s -- pytest-%s" % (
py.std.sys.platform, verinfo,
py.__version__, pytest.__version__),
"*test_header_trailer_info.py .",
"=* 1 passed in *.[0-9][0-9] seconds *=",
])