473,320 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 1919


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jan Decaluwe | last post by:
I'm working on a unit test for a finite state machine (FSM). The FSM behavior is specified in a dictionary called transitionTable. It has a key per state with a tuple of possible transitions as...
7
by: Steven Bethard | last post by:
So, GvR said a few times that he would like to get rid of lambda in Python 3000. Not to start up that war again, but I'm trying to eliminate unnecessary lambdas from my code, and I ran into a case...
4
by: Marek Mänd | last post by:
xHTML 1.0 strict and valid css. But though only IE shows up like I like it. Not Opera7.50PR1, not Mozilla1.6. Mozilla and Opera doesnt take interest in absolute positioning herein this...
5
by: Marek Mänd | last post by:
Please explain to a experienced fool like me, how to hide table rows correctly at this case. http://marekmand.kuubik.ee/iebug_canthide_table_rows_properly.htm Click on the header "label" and see...
3
by: Bruce Cropley | last post by:
Hi all I'm trying to generate test methods in a unittest TestCase subclass, using decorators. I'd like to be able to say: class MyTestCase(unittest.TestCase): @genTests(, , ) def...
1
by: sandeepreddy.pinniti | last post by:
Hi everyone, Iam new into C# technology. I dont know what is QTP and its use. Please help me in this issue. Please send me links through which i can get the data about QTP. How can we map a...
3
by: zlf | last post by:
Hello I'm writing testcase for my console application. One testcase requires to test press Ctrl+C while the application is running. How to send Ctrl+C while running application through...
1
by: dizzy | last post by:
James Kanze wrote: Correct, the char const* uses are very few to worth those versions. Good idea, in my case the code is to be used only on POSIX systems but I'll keep that in mind because...
0
by: Gabriel Genellina | last post by:
En Tue, 19 Aug 2008 18:35:57 -0300, Gustavo Narea <me@gustavonarea.net> escribi�: Do you have any reason for such meta-testing? If you want to ensure that all derived Test classes correctly...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.