[MERGE] fix up test_bench_history

John Arbash Meinel john at arbash-meinel.com
Tue Aug 22 17:50:41 BST 2006


Aaron Bentley wrote:
> John Arbash Meinel wrote:
>>> Aaron Bentley wrote:
>>>
>>>> Hi all,
>>>>
>>>> test_bench_history is inappropriately affected by the cwd.
>>>>
>>>> Specifically, it assumes that it is being run from a bzr.dev tree, and
>>>> will fail if 'bzr selftest test_bench_history' is run in a directory
>>>> other than the bzr tree.
>>>>
>>>> This bundle fixes that by opening the tree containing the module under test.
>>>>
>>>> It also nices up the test, changing a convoluted way of getting
>>>> last_revision to the standard way, and using assertEndsWith instead of
>>>> assert_(str.endswith)
>>>>
>>>> And no, there's no pattern that matches revision-ids in general.  They
>>>> are free-form*.  You could probably write a pattern to match the ones
>>>> generated by bzr, at least right now, but it could go out of date.
>>>>
>>>> Aaron
>>>>
>>>> * technically, revision ids ending in ':' are reserved, and ':' is
>>>> otherwise used to separate namespaces, but these are just conventions.
>>>
>>>
>>> Looks good to me.
>>>
>>> Only problem I see is that it won't work on an installed bzr.
>>> So if we can check for that (say by catching NotBranchError, and just
>>> raising TestSkipped).
>>>
>>> +1 either way. And seems trivial enough for 0.10.
> 
> Thanks.  Merged, with the suggested skip.
> 
> That reminded me about this other outstanding tweak.  Think it's trivial
> enough?
> 
> Aaron

This seems more like a bug fix to the assertDeprecated API, because I
think you meant for the API to do this all along. Right?

Hence, it is a real bugfix, not an API change, and thus is +1 for 0.10.

John
=:->



# Bazaar revision bundle v0.8
#
# message:
#   Made assertDeprecated return the callable's result
# committer: Aaron Bentley <abentley at panoramicfeedback.com>
# date: Thu 2006-08-17 09:32:02.734999895 -0400

=== modified file bzrlib/tests/__init__.py
--- bzrlib/tests/__init__.py
+++ bzrlib/tests/__init__.py
@@ -592,9 +592,9 @@
         method = symbol_versioning.warn
         symbol_versioning.set_warning_method(capture_warnings)
         try:
-            callable(*args, **kwargs)
+            result = callable(*args, **kwargs)
         finally:
-            result = symbol_versioning.set_warning_method(method)
+            symbol_versioning.set_warning_method(method)
         self.assertEqual(expected, local_warnings)
         return result



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060822/cb2bc096/attachment.pgp 


More information about the bazaar mailing list