[MERGE] Automatic discovery of tests

Martin Pool mbp at sourcefrog.net
Mon Nov 12 19:39:17 GMT 2007


On Nov 9, 2007 9:45 AM, Robert Collins <robertc at robertcollins.net> wrote:
>
> On Fri, 2007-11-09 at 09:10 -0500, Martin Pool wrote:
> >
> > > I'm annoyed by the 'UserWarning: file bla bla was not explicitly
> > > unlocked' noise.
> >
> > Is this really hard?  It annoys me too but seems like it should be a
> > one-line fix if someone tracks it down.
>
> Changing it from a warning to an exception will make it very clear where
> it appears :).

(I talked to Robert about this offline) Unfortunately, it will make it
clear that it appears in a del method somewhere.  So Python will
effectively just give a warning anyhow, and it may not be well
correlated with the cause.

We could try something like this: when running a test, hook into the
lock routines so that open locks are held in a set or dictionary.
When completing the test, assert that the dictionary is empty.

Or indeed maybe we should always keep this set, and also force locks
closed when exiting run_bzr.

-- 
Martin



More information about the bazaar mailing list