Q:

nosetests running tests for specific class in multi class python file -m doesnt work!!!!  arggh

I've been at this problem for a day now. :(  Can't figure it out.  Help please. 
I have this setup:
class Parent(object):
    pass # common stuff goes here
class A(Parent, unittest. TestCase):
    pass # A stuff here
class B(Parent, unittest. TestCase):
    pass # B stuff here
I want to use nosetests to run only the tests on class B and parent since B inherits from parent.  I thought I'd use -m or --match to put the class name but it doesnt seem to work. 
Default matching is using --match is '(?: ^|[\b_./-])[Tt]est'
Any ideas? 
Thanks in advance!  

A:

First, check out Nose's documentation about test selection.   It's much easier than what you are trying to do!   If all the test classes A and B are in a file called mytests.py, this command would run only the tests for class A:
nosetests mytests.py:A

You can further limit execution to a single method of class A:
nosetests mytests.py:A.testOne

These can be combined.   To run all test methods for A and only the testTwo method of B, try this:
nosetests mytests.py:A mytests.py:B.testTwo

