[MERGE] More than double the speed of "bzr selftest"

Robert Collins robertc at robertcollins.net
Wed Apr 11 06:45:33 BST 2007


On Wed, 2007-04-11 at 15:18 +1000, Andrew Bennetts wrote:
> 
> +    def run(self, result=None):
> +        try:
> +            return TestCaseWithMemoryTransport.run(self,
> result=result)
> +        finally:
> +            # If the test passed, we can delete its temporary files.
> +            if result is not None and result.wasSuccessful():
> +                # If the test raised TestSkipped during setUp,
> test_dir might
> +                # not be set.
> +                if getattr(self, 'test_dir', None) is not None:
> +                    assert self.test_dir.endswith('/work'),
> self.test_dir
> +                    shutil.rmtree(self.test_dir[:-len('/work')])
> +
>      def makeAndChdirToTestDir(self):
>          """See TestCaseWithMemoryTransport.makeAndChdirToTestDir().

Can I suggest two things - a test for this; and that tearDown is the
right place to do this; I'm of the opinion (strongly held) that the test
can delete everything whether or not it passed. We lose plenty of state
when tearDown runs already; debugging requires debugging before tearDown
already.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070411/b6a2bc1a/attachment.pgp 


More information about the bazaar mailing list