473,491 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

creating test suites

13 New Member
I am a newbie and that says it all about posting a basic doubt. I still hope someone helps me out .

I am unit testing some modules. My test module is in diff file than the modules
to be tested. My code is something like this :

<PRE>

class xyz(unittest.TestCase):

def testAbc():
.....
def testPqr():
.....
def testKlm():
.....

def makeTestSuite():

suite = unittest.TestSuite()
suite.addTest(xyz("testAbc"))
suite.addTest(xyz("testPqr"))
return suite

if __name__ == "__main__":
unittest.main()

</PRE>
But, though i am adding only tow test cases in the test suite, all the 3 test cases are running. I cannot figure out the reson. Could someone please help me?

Regards,
rdps
Nov 13 '06 #1
3 1579
bartonc
6,596 Recognized Expert Expert
I am a newbie and that says it all about posting a basic doubt. I still hope someone helps me out .

I am unit testing some modules. My test module is in diff file than the modules
to be tested. My code is something like this :

<PRE>

class xyz(unittest.TestCase):

def testAbc():
.....
def testPqr():
.....
def testKlm():
.....

def makeTestSuite():

suite = unittest.TestSuite()
suite.addTest(xyz("testAbc"))
suite.addTest(xyz("testPqr"))
return suite

if __name__ == "__main__":
unittest.main()

</PRE>
But, though i am adding only tow test cases in the test suite, all the 3 test cases are running. I cannot figure out the reson. Could someone please help me?

Regards,
rdps
Great question! I'll do some research and get back to you. In the meanwhile, please read the posting guidelines located in the panel on the right as you post or the sticky (first post) on this forum to learn how to use code tags around code in your post. It helps us help you. Thanks,
Barton (PFM)
Nov 13 '06 #2
fuffens
38 New Member
Try to use
Expand|Select|Wrap|Line Numbers
  1. unittest.TextTestRunner(verbosity=2).run(suite)
instead of
Expand|Select|Wrap|Line Numbers
  1. unittest.main()
to see if it makes any difference.

BR
/Fredrik
Nov 13 '06 #3
rdps
13 New Member
Thanks for the replies...but the solution doesnt seem to work for me. All the test cases run, evn though i want to run only 2 of the three test cases.

Currently i am using Eclipse IDE for running the tests but in future i plan to run the test suites through command line. Any pointers regarding how to run the test suite from command line?
Nov 14 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

41
10223
by: Roy Smith | last post by:
I've used the standard unittest (pyunit) module on a few projects in the past and have always thought it basicly worked fine but was just a little too complicated for what it did. I'm starting a...
2
1979
by: vadi | last post by:
Can any one help me in finding the test suite (test C++ examples) for testing the C++ parser.
7
3088
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
6
1162
by: Param R. | last post by:
Hi all, could someone recommend some good control suites for asp.net that I can purchase. I am specifically looking for enhanced controls like calendaring, scheduling, menus, treets and charts(all...
5
2476
by: VvanN | last post by:
hi, fellows I'd like to intruduce a new unit test framework for C++ freely available at: http://unit--.sourceforge.net/ It does not need bothering test registration, here is an example ...
17
2502
by: CBFalconer | last post by:
David Brown wrote: .... snip ... The problem with the gcc test suite is that it is geared to the gcc 'standard', rather than the ISO standard. A test suite should be open-source, and there...
176
8183
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write...
48
2444
by: Ark Khasin | last post by:
Unit testing is an integral component of both "formal" and "agile" models of development. Alas, it involves a significant amount of tedious labor. There are test automation tools out there but...
2
2014
by: prem | last post by:
Hi, Anybody know if there are any *FREE* ANSI C test suite for C/C++ for Compiler available? Any link/pointers is appreciated /Prem
0
7115
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,...
0
7154
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,...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5451
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,...
0
4578
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...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
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 ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
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...

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.