[TIP] unittest2/nose2: plugin interaction or overrides or ... ?
fuzzyman at voidspace.org.uk
Sun Aug 29 13:03:14 PDT 2010
On 26/08/2010 16:29, jason pellerin wrote:
> Next up on my nose2 compatibility checklist is squeezing nose's
> support for implicit generator tests and for more names for test
> functions' fixtures (setup and teardown in addition to setUp and
> tearDown for instance) into nose2. unittest2's moduleloading plugin is
> about 90% there, but I think it will be important for nose2 uptake to
> avoid making people rename 1,000 setup functions and/or tag 1,000
> generator tests manually in pre-existing test suites. So I'm trying to
> figure out what is the best way to interact with moduleloading from
> another plugin.
> Right now I can see 2 solutions: I can force my plugin to run first so
> that it has a chance to load test objects and change or add the
> attributes that moduleloading is looking for. Or I can subclass some
> of the moduleloading plugins, force moduleloading not to load, and
> load my plugin instead.
Hmm... in this case I don't want to add multiple ways to do this to
support backwards compatibility with nose. I think the easiest way to do
this is to add moduleloading to 'excludedplugins' in the nose2 config
file and provide your own functionality instead.
Let me know if I can change anything in moduleloading (I don't like the
name and may change it - suggestions welcomed) to make it more reusable.
All the best,
> Neither of those seems like something I actually want to do, though.
> So I'm trolling for better ideas. Got any?
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
More information about the testing-in-python