[MERGE] More windows test fixes

John Arbash Meinel john at arbash-meinel.com
Thu Aug 14 17:40:58 BST 2008


John Arbash Meinel has voted tweak.
Status is now: Semi-approved
Comment:
-        self.addCleanup(result_basis.unlock)
-        self.assertEqual(expected_inventory, result_basis.inventory)
+        try:
+            self.assertEqual(expected_inventory, 
result_basis.inventory)
+        finally:
+            result_basis.unlock()

^- Why is addCleanup not sufficient here?
I guess I'm concerned because we use addCleanup in a lot of places, so 
if it
isn't working, then we will have a lot of knock-on places to fix up. So 
I'd
certainly rather get addCleanup working.


-        real_os_link = os.link
+        try:
+            real_os_link = os.link
+        except AttributeError:
+            raise TestSkipped("This platform doesn't provide os.link")

^- I think this would be better as

real_os_link = getattr(os, 'link', None)
if real_os_link is None:
     raise TestNotApplicable('This platform does not provide os.link')

N/A because there isn't really a way for a user to provide the support.

I would also like to see us do it at the beginning of the test, so that 
you
don't spend the time to do commit, etc, just to abort the test.


The rest seems good.


For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C01f501c8fc82%24b386c0c0%241a944240%24%40com.au%3E
Project: Bazaar



More information about the bazaar mailing list