Message2062

Author agoucher
Recipients
Date 2008-01-23.20:28:30
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I tripped over a partially fixed problem in unittest.py today.

loadTestsFromName has been changed already to look whether the class it is looking in for tests is subclassed from unittest.TestCase. loadTestsFromModule however still just looks for TestCase. This results in not being able to find tests in a class that is not a direct subclass of TestCase.

The following structure currently won't work:
module A..
class A(unittest.TestCase):
    pass

module B...
import A

class B(A.A)
    def testFoo(self):
        print "blah blah blah"

I have attached the patch to fix this.
History
Date User Action Args
2008-02-20 17:18:09adminlinkissue1878473 messages
2008-02-20 17:18:09admincreate