← Back to team overview

launchpad-dev team mailing list archive

Re: Running txlongpoll tests with subunit/testtools

 

On 7 November 2011 20:16, Robert Collins <robert.collins@xxxxxxxxxxxxx> wrote:
> For the oops-* projects I've just done
> bin/py -m subunit.run package.tests.test_suite
> or equally we could do
> bin/py -m subunit.run discover
>
> And it should Just Work.

Interesting, that works. Which is a little alarming too, because
buildout.cfg has include-site-packages=false. Ah, but subunit is
installed in dist-packages, and I'm going to guess that buildout
doesn't know about that.

> When you say 'entry point' do you mean having a function that takes
> argv, which buildout can make a dedicated script for? We can do that
> for subunit pretty easily, I think.

Yes, though it's a no-arg function. testtools has a main(argv, stream)
which was easy to monkey-patch in buildout.cfg.

There is also the problem that subunit is not egg/setuptools
friendly. If I define it as a dependency in setup.py then buildout
breaks. If I don't define it then I can't declare its use as an egg in
one of the buildout recipes, and so it won't be available in theory,
except we've seen that it actually is.

There is a promising allowed-eggs-from-site-packages setting that
sounds like it might be a reasonable workaround, but it seems to have
no effect, for reasons similar to why include-site-packages=false has
little effect I imagine.

Even as I get more to grips with buildout my feeling that it's fairly
leaky magic is not being dispelled!

Gavin.


References