← Back to team overview

launchpad-dev team mailing list archive

Re: Interactive test runner

 

On Wed, 2010-02-24 at 11:26 -0300, Guilherme Salgado wrote:
> 
> I'd really like to be able to get this thing working, but given the
> above I'm thinking it may not be feasible, so I'm dropping it for
> now.  
> 
> I'd be happy to reconsider that decision if anybody has any ideas for
> working around these issues. 

I think its an interesting idea. There are a few issues you'll have with
it:
 - things outside of python modules affect whats loaded (zcml. page
templates)
 - reload() doesn't actually free objects associated with a module, so
   you can end up running an old objects code after a reload - and for
   entertainment value, this can sometimes run old code objects against
   new class objects - which throws a first parameter must be a Bar
   but was a Bar error.

These two points speak to the difficulty assessing what needs to be
reloaded:
Given module A that imports from module B; you have to reload A if you
reload B, you may well find that changing nearly any class results in a
very wide reload as a matter of course. The habit of importing from
intermediate modules makes this worse (because it acts as a multiplier),

So even if you fix the repeated import problem that zope utilities and
whatnot have (I suggest writing a module specific 'unload()' and calling
that before reloading)

I'd be inclined to work on faster loading and execution of just a few
tests, we've had great success in bzr doing that:

$ ./bzr selftest --no-plugins -s bt.test_selftest --parallel=fork
bzr
selftest: /home/robertc/source/baz/bzr.dev/bzr                                                                                                                                                                 
   /home/robertc/source/baz/bzr.dev/bzrlib
   bzr-2.2.0dev1 python-2.6.4
Linux-2.6.32-14-generic-x86_64-with-Ubuntu-10.04-lucid

                                                                                                                                                                                                                   
----------------------------------------------------------------------
Ran 193 tests in 2.619s


-Rob

Attachment: signature.asc
Description: This is a digitally signed message part


References