The script-based test is a red herring. This also fails under run_bzr:
out, err = self.run_bzr('hooks')
self.assertContainsRe(out, 'hook is a test')
Apparently bzrlib.tests.TestCase clears out all of the hooks before it runs. One can work around this by installing the hook in the test as is done in the bzrlib tests. This doesn't allow the same level of integration testing but it is understandable for isolation purposes.
The script-based test is a red herring. This also fails under run_bzr:
out, err = self.run_ bzr('hooks' ) ainsRe( out, 'hook is a test')
self.assertCont
Apparently bzrlib. tests.TestCase clears out all of the hooks before it runs. One can work around this by installing the hook in the test as is done in the bzrlib tests. This doesn't allow the same level of integration testing but it is understandable for isolation purposes.