[stem/master] Note python interpreter in test output

commit 7cd58724f0a3ad8bcbdb7c6f7a11522df8dafb5d Author: Damian Johnson <atagar@torproject.org> Date: Mon Oct 8 10:56:08 2018 -0700 Note python interpreter in test output Our test output notes our python version but not the intterpreter type. This caused Pypy for instance to look like CPython 2.7. Intercluding the interpreter in the version string if it isn't CPython. --- test/task.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/task.py b/test/task.py index d1c1d6c7..a763e710 100644 --- a/test/task.py +++ b/test/task.py @@ -75,6 +75,13 @@ def _check_tor_version(tor_path): return str(test.tor_version(tor_path)).split()[0] +def _check_python_version(): + interpreter = platform.python_implementation() + version = platform.python_version() + + return version if interpreter == 'CPython' else '%s (%s)' % (interpreter, version) + + def _check_platform_version(): if platform.system() == 'Windows': extra = platform.release() @@ -271,7 +278,7 @@ class StaticCheckTask(Task): STEM_VERSION = Task('stem version', lambda: stem.__version__) TOR_VERSION = Task('tor version', _check_tor_version) -PYTHON_VERSION = Task('python version', lambda: platform.python_version()) +PYTHON_VERSION = Task('python version', _check_python_version) PLATFORM_VERSION = Task('operating system version', _check_platform_version) CRYPTO_VERSION = ModuleVersion('cryptography version', 'cryptography', stem.prereq.is_crypto_available) PYNACL_VERSION = ModuleVersion('pynacl version', 'nacl', stem.prereq._is_pynacl_available)
participants (1)
-
atagar@torproject.org