Code review comment for lp:~gz/bzr/tests_for_bug_205636

Revision history for this message
John A Meinel (jameinel) wrote :

63 + try:
64 + tree.smart_add(["dir"])
65 + except AttributeError, e:
66 + self.expectFailure("Adding dir raises AttributeError",
67 + self._reraise_current_error_as_assertion)

^- Looking at this, I don't see any reason why expectFailure would "run the code".

If you did:

self.expectFailure("Adding dir raises AttributeError",
  self._reraise_error_as_assertion, tree.smart_add, ['dir'])

Or something along those lines, then I could see your point. The try/except code means that you will *only* call self._reraise_current... if an exception has already triggered, and as such you always know that the code is executing, etc.

try:
 ...
except AttributeError:
  self.knownFailure(...)

is much more straightforward.

« Back to merge proposal