Code review comment for lp:~mbp/bzr/remove-logging

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

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

Martin Pool wrote:
>> IIUIC, note messages are no longer suppressed if --quiet is passed which is wrong. A simple if test added to note() ought to fix it?
>
> This is in fact broken; test added.
>
>
> === modified file 'bzrlib/tests/test_trace.py'
> --- bzrlib/tests/test_trace.py 2009-11-08 19:07:00 +0000
> +++ bzrlib/tests/test_trace.py 2009-12-10 05:43:18 +0000
> @@ -27,6 +27,8 @@
>
> from bzrlib import (
> errors,
> + trace,
> + ui,
> )
> from bzrlib.tests import TestCaseInTempDir, TestCase
> from bzrlib.trace import (
> @@ -263,8 +265,19 @@
> # Confirm the old API still works
> be_quiet(True)
> self.assertEqual(-1, get_verbosity_level())
> +
> + out = StringIO()
> + err = StringIO()
> + ui.ui_factory = ui.text.TextUIFactory(StringIO(''), out, err)
> + trace.note("sample note")
> + self.assertEqual('', out.getvalue())
> + self.assertEqual('', err.getvalue())
> +
> be_quiet(False)
> self.assertEqual(0, get_verbosity_level())
> + trace.note("sample note")
> + self.assertEqual('', out.getvalue())
> + self.assertEqual('bzr: sample note', err.getvalue())
>
>
> class TestBzrLog(TestCaseInTempDir):
>
>

The test looks reasonable, though this doesn't show the fix :).

Also, it seems a bit of a shame not to have these isolated into separate
tests.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksgkKIACgkQJdeBCYSNAANulACdFGsbMowXmSC93j537PBhzY9U
BlMAoMU0Od7MXnSYzkMuIgx139hcCUUp
=qJdX
-----END PGP SIGNATURE-----

« Back to merge proposal