Rev 4810: Report the test-id when we fail to delete a testing dir. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-test-kipple
John Arbash Meinel
john at arbash-meinel.com
Wed Nov 18 17:22:26 GMT 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-test-kipple
------------------------------------------------------------
revno: 4810
revision-id: john at arbash-meinel.com-20091118172218-8af5g41v0kr54mq1
parent: john at arbash-meinel.com-20091118171041-zcizhane79vnq6uo
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-test-kipple
timestamp: Wed 2009-11-18 11:22:18 -0600
message:
Report the test-id when we fail to delete a testing dir.
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2009-11-16 19:56:24 +0000
+++ b/bzrlib/tests/__init__.py 2009-11-18 17:22:18 +0000
@@ -2382,7 +2382,7 @@
# recreate a new one or all the followng tests will fail.
# If you need to inspect its content uncomment the following line
# import pdb; pdb.set_trace()
- _rmtree_temp_dir(root + '/.bzr')
+ _rmtree_temp_dir(root + '/.bzr', test_id=self.id())
self._create_safety_net()
raise AssertionError('%s/.bzr should not be modified' % root)
@@ -2577,7 +2577,7 @@
def deleteTestDir(self):
os.chdir(TestCaseWithMemoryTransport.TEST_ROOT)
- _rmtree_temp_dir(self.test_base_dir)
+ _rmtree_temp_dir(self.test_base_dir, test_id=self.id())
def build_tree(self, shape, line_endings='binary', transport=None):
"""Build a test tree according to a pattern.
@@ -4101,7 +4101,7 @@
return new_test
-def _rmtree_temp_dir(dirname):
+def _rmtree_temp_dir(dirname, test_id=None):
# If LANG=C we probably have created some bogus paths
# which rmtree(unicode) will fail to delete
# so make sure we are using rmtree(str) to delete everything
@@ -4119,6 +4119,9 @@
# We don't want to fail here because some useful display will be lost
# otherwise. Polluting the tmp dir is bad, but not giving all the
# possible info to the test runner is even worse.
+ if test_id != None:
+ ui.ui_factory.clear_term()
+ sys.stderr.write('While running: %s\n' % (test_id,))
sys.stderr.write('Unable to remove testing dir %s\n%s'
% (os.path.basename(dirname), e))
More information about the bazaar-commits
mailing list