Rev 4267: Sniff KnownFailure etc harder when reading subunit results. in http://people.ubuntu.com/~robertc/baz2.0/pending/tests.sniff_subunit_harder

Robert Collins robertc at robertcollins.net
Wed Apr 8 08:18:33 BST 2009


At http://people.ubuntu.com/~robertc/baz2.0/pending/tests.sniff_subunit_harder

------------------------------------------------------------
revno: 4267
revision-id: robertc at robertcollins.net-20090408071826-jzion9x6h7ik8vxs
parent: pqm at pqm.ubuntu.com-20090407180335-g11gve6533bv8lei
committer: Robert Collins <robertc at robertcollins.net>
branch nick: tests.sniff_subunit_harder
timestamp: Wed 2009-04-08 17:18:26 +1000
message:
  Sniff KnownFailure etc harder when reading subunit results.
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2009-04-07 13:56:43 +0000
+++ b/bzrlib/tests/__init__.py	2009-04-08 07:18:26 +0000
@@ -3020,12 +3020,11 @@
             # stringify the exception gives access to the remote traceback
             # We search the last line for 'prefix'
             lines = str(exc).split('\n')
-            if len(lines) > 1:
-                last = lines[-2] # -1 is empty, final \n
-            else:
-                last = lines[-1]
-            if last.startswith(prefix):
-                value = last[len(prefix):]
+            while lines and not lines[-1]:
+                lines.pop(-1)
+            if lines:
+                if lines[-1].startswith(prefix):
+                    value = lines[-1][len(prefix):]
         return value
 
 




More information about the bazaar-commits mailing list