473,811 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Grandchildren of TestCase don't work

En Tue, 19 Aug 2008 18:35:57 -0300, Gustavo Narea <me@gustavonare a.net>
escribi�:
Hello, everyone.

Why do unitest.TestCas e grand-grandchildren not work?

I've created a unittest.TestCa se 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).
Do you have any reason for such meta-testing?
If you want to ensure that all derived Test classes correctly set the
database and model attributes, just check that condition in another test
method on your base class (DBTest).
Currently you are trying to check whether the code is actually checking
the condition... I'm not sure of the usefulness of such meta-testing, even
if it worked.
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._testMetho dName)
AttributeError : 'TestDatabaseGr andChildTesting ' object has no
attribute '_testMethodNam e'
I get a different exception: ValueError: no such test method in <class
'__main__.Empty TestCase'>: runTest, which is perfectly reasonable given
that you're constructing TestCase instances by hand, with no arguments -
so the default test method "runTest" is used, and you haven't provided
such method.

--
Gabriel Genellina

Aug 20 '08 #1
0 909

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1988
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 the corresponding value. A transition is defined as a number of input values, a next state, and a documentation string. I want to test each possible transition in a separate test method. For a particular transition, a test method could look as...
7
2300
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 using unittest.TestCase that I don't really know how to deal with. Previously, I had written some code like: self.assertRaises(ValueError, lambda: method(arg1, arg2)) This was a simple fix because assertRaises takes *args and **kwds, so
4
2861
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 testcase (2800 B) at all: http://www.hot.ee/idaliiga/bronn1test.htm (MSIE screenshot http://www.hot.ee/idaliiga/bronn1test.gif)
5
2343
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 how IE6 SP1 draws the borders wrongly. How it can be patched? Does that mean, that with the collapsed border table model one cannot set the display of rows successfully with no side effects in IE6 SP1?
3
1517
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 something(self, side, price, someFlag): # etc...
1
1834
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 TestCase with QTP automation script. Please help me Regards,
3
4030
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 System.Diagnostics.Process? I know I can simulate input through p.StandardInput.WriteLine, but I do not know what exactly input string represents "Ctrl+C". Thanks
1
164
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 I too like to write portable code even when not required.
1
1943
by: Gustavo Narea | last post by:
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).
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.