^- 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.
63 + try: add(["dir" ]) ure("Adding dir raises AttributeError", current_ error_as_ assertion)
64 + tree.smart_
65 + except AttributeError, e:
66 + self.expectFail
67 + self._reraise_
^- Looking at this, I don't see any reason why expectFailure would "run the code".
If you did:
self.expectFail ure("Adding dir raises AttributeError", _reraise_ error_as_ assertion, tree.smart_add, ['dir'])
self.
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: knownFailure( ...)
...
except AttributeError:
self.
is much more straightforward.