New submission from Adam Goucher:

There are a couple places in unittest where 'issubclass(something,
TestCase)' is used. This prevents you from organizing your test code via
class hierarchies. To solve this problem, issubclass should be looking
whether the object is a subclass of unittest.TestCase to walk the
inheritance tree all the way up and not just a single level.

Currently, this will not 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 a patch which will address all locations where this
could happen.

----------
components: Library (Lib)
files: cpython-unittest-subclass.diff
messages: 61776
nosy: agoucher
severity: normal
status: open
title: fix using unittest as a superclass
versions: Python 2.5
Added file: http://bugs.python.org/file9311/cpython-unittest-subclass.diff

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1955>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to