On May 20, 5:13 pm, Kumar McMillan <
kumar.mcmil...@gmail.com> wrote:
> On Wed, May 20, 2009 at 3:49 PM, Vicki <
laid...@stsci.edu> wrote:
>
> > Thanks - I will bear this in mind for the general case of including or
> > excluding
> > classes; although I think it will fail for the specific case of "run
> > the subclasses, but not
> > the base class", won't it?
>
> yes, it would
Ah ok - I'm not familiar with metaclasses so wasn't sure I was reading
it correctly.
>
> > In any event, all of these possible workarounds seem like very
> > complicated solutions
> > to what ought in principle to be a simple problem.
>
> keep in mind you can always just run all tests in a specific class like this:
>
> $ nosetests myapp/tests/test_something.py:TheClass
Good to know; of course it works for matching but not for excluding.
>
>
> > I'd like to understand whether it is in fact _not_ a simple problem,
> > or whether this is just a use case that's missing from the UI.
>
> it sounds like you are after something more like:
>
> $ nosetests --run-tests-from-subclass MyBaseTest
>
> ?
That would solve this particular problem, but it seems needlessly
specific.
I really want to be able to match or exclude based on the
CaseName.testname
pattern:
nosetests -e "MyBase.*"
The -exclude switch takes regular expressions. That's a legal regular
expression
that should match MyBase.testfoo. (Or some variant of it should, MyBase
\..* or something.)
More generally I might want to do
nosetests -m "ClassM.*" to select a group of classes and all their
tests.
I don't understand why this doesn't work in the first place. The fact
that it doesn't makes me think there must be a reason: maybe there's
something going on behind the scenes that I don't understand, or some
restriction on what part of the test name is available to the piece of
code that's processing those match and exclude flags.
thanks,
Vicki