[patch] [0.12] remove BzrNewError, cleanup exceptions and users

Martin Pool mbp at canonical.com
Fri Nov 3 02:00:05 GMT 2006


On  2 Nov 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> Martin Pool wrote:
> 
> It looks like you addressed all of my comments, but you forgot to update
> HACKING.

Thanks.

> > === modified file 'bzrlib/tests/__init__.py'
> > --- bzrlib/tests/__init__.py	2006-11-02 07:47:25 +0000
> > +++ bzrlib/tests/__init__.py	2006-11-02 10:15:49 +0000
> > @@ -666,7 +666,7 @@
> >              a_callable(*args, **kwargs).
> >          """
> >          local_warnings = []
> > -        def capture_warnings(msg, cls, stacklevel=None):
> > +        def capture_warnings(msg, cls=None, stacklevel=None):
> >              # we've hooked into a deprecation specific callpath,
> >              # only deprecations should getting sent via it.
> >              self.assertEqual(cls, DeprecationWarning)
> > 
> 
> ^- Why did you make 'cls' an optional parameter. I was pretty sure that
> it was required, because it is required for 'warnings.warn()' which is
> are default warning algorithm.

No it's not:

  warn(	message[, category[, stacklevel]])

  http://docs.python.org/lib/warning-functions.html
 
> Though I would like to change it so that symbol_versioning.warn is a
> *wrapper* around it (which can pass DeprecationWarning by default),
> rather than directly being that function.

Agree.

> > === modified file 'bzrlib/tests/test_selftest.py'
> > --- bzrlib/tests/test_selftest.py	2006-10-29 07:08:01 +0000
> > +++ bzrlib/tests/test_selftest.py	2006-11-02 09:38:09 +0000
> > @@ -846,7 +846,7 @@
> >          sample_test.run(result)
> >          self.assertContainsRe(
> >              output_stream.getvalue(),
> > -            "[1-9][0-9]ms/   [1-9][0-9]ms\n$")
> > +            r"\d+ms/ +\d+ms\n$")
> >          
> 
> ^- I'm not sure how this got mixed in with your other changes. I'm okay
> with it, but I thought we weren't positive about how lax we wanted to be
> about the number of milliseconds it takes to run.

We shouldn't have any tests which can spuriously fail.  If we need to be
tighter here (and since it's already working i don't think we do) we'd
need to fake the timing.

-- 
Martin




More information about the bazaar mailing list