Default hook state and the test suite
Andrew Bennetts
andrew.bennetts at canonical.com
Tue Oct 19 01:03:42 BST 2010
John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm worried about a whole in our testing setup. Specifically, we have at
[...]
> For now, I just moved the "register this hook" override back into all of
> the "bzr status" blackbox tests. But it feels like we should have a more
> generic solution, because this is easily missed.
This probably isn't the generic solution you are looking for, but it is
what we have today...
See the last two lines of TestCase._clear_hooks:
# this hook should always be installed
request._install_hook()
('request' here is bzrlib.smart.request)
I think we should arrange for “always installed” hooks to be installed
after TestCase._clear_hooks has run. It would be nice to make this more
automatic, so that future always installed hooks are automatically taken
into account here.
Part of me wonders if always-installed hooks are a bit of a code smell,
though...
-Andrew.
More information about the bazaar
mailing list