[merge][0.11][critical] test log problems

Aaron Bentley aaron.bentley at utoronto.ca
Sun Sep 24 18:41:45 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> I expanded on this with some test cases, since Carl didn't have time
> right now.

> === modified file bzrlib/tests/__init__.py
> --- bzrlib/tests/__init__.py
> +++ bzrlib/tests/__init__.py
> @@ -244,8 +244,8 @@
>          unittest.TestResult.addError(self, test, err)
>          # We can only do this if we have one of our TestCases, not if
>          # we have a doctest.
> -        setKeepLogFile = getattr(test, 'setKeepLogFile', None)
> -        if setKeepLogFile is not None:
> +        setKeepLogfile = getattr(test, 'setKeepLogfile', None)
> +        if setKeepLogfile is not None:
>              setKeepLogfile()

For later, it might make sense to delete the log on success, instead of
keeping it on failure/error.

> +
> +        log = test._get_log()
> +        self.assertContainsRe(log, 'this will be kept')
> +        self.assertEqual(log, test._log_contents)
>  
>  class TestTestCase(TestCase):
>      """Tests that test the core bzrlib TestCase."""

PEP8 requires another newline, I think.  Otherwise, +1.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFFsNY0F+nu1YWqI0RAh6hAKCGNB2qMv9sjjF0jtKWMKu7CfkcFgCeK+Z4
Qm0LUAVJVkn29bbgT1backQ=
=ix22
-----END PGP SIGNATURE-----




More information about the bazaar mailing list