From 9b25eb7cdb41f653fa274f1024a7c007aa7176ff Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 14 Oct 2013 16:19:36 -0700 Subject: [PATCH 1/3] More concise test summary info --- IPython/testing/iptestcontroller.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index c77d42ef2..ba7027be2 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -29,7 +29,7 @@ import time from .iptest import have, test_group_names, test_sections from IPython.utils.py3compat import bytes_to_str -from IPython.utils.sysinfo import sys_info +from IPython.utils.sysinfo import brief_sys_info from IPython.utils.tempdir import TemporaryDirectory @@ -206,7 +206,7 @@ def do_run(controller): def report(): """Return a string with a summary report of test-related variables.""" - out = [ sys_info(), '\n'] + out = [ brief_sys_info(), '\n'] avail = [] not_avail = [] @@ -327,17 +327,16 @@ def run_iptestall(options): print('_'*70) print('Test suite completed for system with the following information:') print(report()) - print('Ran %s test groups in %.3fs' % (nrunners, t_tests)) - print() + took = "Took %.3fs." % t_tests print('Status: ', end='') if not failed: - print('OK') + print('OK.', took) else: # If anything went wrong, point out what command to rerun manually to # see the actual errors and individual summary failed_sections = [c.section for c in failed] print('ERROR - {} out of {} test groups failed ({}).'.format(nfail, - nrunners, ', '.join(failed_sections))) + nrunners, ', '.join(failed_sections)), took) print() print('You may wish to rerun these, with:') print(' iptest', *failed_sections) From 404fa0f034b6151d21c800d0e0e546d856f3fcfe Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 14 Oct 2013 16:22:19 -0700 Subject: [PATCH 2/3] Restore mention of number of test groups after success --- IPython/testing/iptestcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index ba7027be2..348cdb74c 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -330,7 +330,7 @@ def run_iptestall(options): took = "Took %.3fs." % t_tests print('Status: ', end='') if not failed: - print('OK.', took) + print('OK (%d test groups).' % nrunners, took) else: # If anything went wrong, point out what command to rerun manually to # see the actual errors and individual summary From bc16465b66f15f1e8f10630a66252c75eeb3eab7 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Tue, 22 Oct 2013 15:15:56 -0700 Subject: [PATCH 3/3] Clean up formatting sys info for test report --- IPython/testing/iptestcontroller.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 348cdb74c..423094a25 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -28,8 +28,9 @@ import subprocess import time from .iptest import have, test_group_names, test_sections +from IPython.utils.path import compress_user from IPython.utils.py3compat import bytes_to_str -from IPython.utils.sysinfo import brief_sys_info +from IPython.utils.sysinfo import get_sys_info from IPython.utils.tempdir import TemporaryDirectory @@ -205,8 +206,20 @@ def do_run(controller): def report(): """Return a string with a summary report of test-related variables.""" - - out = [ brief_sys_info(), '\n'] + inf = get_sys_info() + out = [] + def _add(name, value): + out.append((name, value)) + + _add('IPython version', inf['ipython_version']) + _add('IPython commit', "{} ({})".format(inf['commit_hash'], inf['commit_source'])) + _add('IPython package', compress_user(inf['ipython_path'])) + _add('Python version', inf['sys_version'].replace('\n','')) + _add('sys.executable', compress_user(inf['sys_executable'])) + _add('Platform', inf['platform']) + + width = max(len(n) for (n,v) in out) + out = ["{:<{width}}: {}\n".format(n, v, width=width) for (n,v) in out] avail = [] not_avail = []