Grandchildren of TestCase don't work

Gustavo Narea me at
Tue Aug 19 23:35:57 CEST 2008

Hello, everyone.

Why do unitest.TestCase grand-grandchildren not work?

I've created a unittest.TestCase descendant, which contains the setUp() and
tearDown() for testing some components of a web framework. Every
application based on this framework should subclass this base class once,
and the rest of the test cases must also subclass the base TestCase of the
application (which is a direct descendant of my descendant of TestCase).

But grandchildren of my TestCase don't work, and I get this weird error:
>   File "/usr/lib/python2.5/", line 248, in run
>     testMethod = getattr(self, self._testMethodName)
> AttributeError: 'TestDatabaseGrandChildTesting' object has no
> attribute '_testMethodName'

Isn't it possible to use grand-grandchildren of unittest.TestCase?

Please use this file to reproduce it:

Thanks in advance.
Gustavo Narea.

Get rid of unethical constraints! Switch to Freedomware:

More information about the Python-list mailing list