From 501eb4f9166f8d7d61e52afb125e940c48b9fa54 Mon Sep 17 00:00:00 2001 From: Bob Lantz <rlantz@cs.stanford.edu> Date: Mon, 13 Oct 2014 13:52:43 -0700 Subject: [PATCH] Add more information for test condition failure --- examples/test/test_linearbandwidth.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/test/test_linearbandwidth.py b/examples/test/test_linearbandwidth.py index c471e2cb..b431d7b2 100755 --- a/examples/test/test_linearbandwidth.py +++ b/examples/test/test_linearbandwidth.py @@ -34,8 +34,11 @@ def testLinearBandwidth( self ): bw *= 10 ** 9 # check that we have a previous result to compare to if n != 1: - self.assertTrue( bw < previous_bw ) - previous_bw = bw + info = ( 'bw: %d bits/s across %d switches, ' + 'previous: %d bits/s across %d switches' % + ( bw, n, previous_bw, previous_n ) ) + self.assertTrue( bw < previous_bw, info ) + previous_bw, previous_n = bw, n else: break -- GitLab