471,573 Members | 1,158 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,573 software developers and data experts.

Grandchildren of TestCase don't work

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/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/

Aug 19 '08 #1
1 1860


Gustavo Narea wrote:
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/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.
Aug 20 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jan Decaluwe | last post: by
7 posts views Thread by Steven Bethard | last post: by
3 posts views Thread by Bruce Cropley | last post: by
1 post views Thread by sandeepreddy.pinniti | last post: by
3 posts views Thread by zlf | last post: by
1 post views Thread by dizzy | last post: by
reply views Thread by Gabriel Genellina | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.