Rev 4268: (robertc) Handle KnownFailure etc properly in subunit results to in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Apr 8 09:42:35 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4268
revision-id: pqm at pqm.ubuntu.com-20090408084231-3wvecksg40vgchzo
parent: pqm at pqm.ubuntu.com-20090408062211-qhu50uezgnlj7ked
parent: robertc at robertcollins.net-20090408071826-jzion9x6h7ik8vxs
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-04-08 09:42:31 +0100
message:
  (robertc) Handle KnownFailure etc properly in subunit results to
  	support the ec2test plugin more. (Robert Collins)
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
    ------------------------------------------------------------
    revno: 4266.1.1
    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:
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2009-04-08 03:34:31 +0000
+++ b/bzrlib/tests/__init__.py	2009-04-08 08:42:31 +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