From d220be8468f090f42159616aee4b7d734499fea3 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Sun, 31 May 2015 20:31:31 +0100 Subject: [PATCH] Use platform.python_version() to show Python version number This results in something like "3.5.0b2" for non-final releases while still being "3.5.0" for final releases. --- _pytest/terminal.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_pytest/terminal.py b/_pytest/terminal.py index 1eebfd48c..576893bbf 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -7,6 +7,7 @@ import pluggy import py import sys import time +import platform def pytest_addoption(parser): @@ -274,7 +275,7 @@ class TerminalReporter: if not self.showheader: return self.write_sep("=", "test session starts", bold=True) - verinfo = ".".join(map(str, sys.version_info[:3])) + verinfo = platform.python_version() msg = "platform %s -- Python %s" % (sys.platform, verinfo) if hasattr(sys, 'pypy_version_info'): verinfo = ".".join(map(str, sys.pypy_version_info[:3]))