Connecting Tech Pros Worldwide Forums | Help | Site Map

Grandchildren of TestCase don't work

Gustavo Narea
Guest
 
Posts: n/a
#1: Aug 19 '08
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:
Quote:
Â* File "/usr/lib/python2.5/unittest.py", 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: http://paste.turbogears.org/paste/4721

Thanks in advance.
--
Gustavo Narea.
http://gustavonarea.net/

Get rid of unethical constraints! Switch to Freedomware:
http://softwareliberty.com/


infixum
Guest
 
Posts: n/a
#2: Aug 20 '08

re: Grandchildren of TestCase don't work




Gustavo Narea wrote:
Quote:
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:
Quote:
* File "/usr/lib/python2.5/unittest.py", 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: http://paste.turbogears.org/paste/4721
>
Thanks in advance.
--
Gustavo Narea.
http://gustavonarea.net/
>
Get rid of unethical constraints! Switch to Freedomware:
http://softwareliberty.com/
I could be wrong, but I think I saw this crossposted on the TIP list -
not sure which one was first.
Closed Thread