473,885 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ 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.Te stCase):

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

def makeTestSuite() :

suite = unittest.TestSu ite()
suite.addTest(x yz("testAbc"))
suite.addTest(x yz("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 1600
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.Te stCase):

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

def makeTestSuite() :

suite = unittest.TestSu ite()
suite.addTest(x yz("testAbc"))
suite.addTest(x yz("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
10323
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 new project now and I'm thinking of trying py.test (http://codespeak.net/py/current/doc/test.html). It looks pretty cool from the docs. Is there anybody out there who has used both packages and can give a comparative review?
2
2011
by: vadi | last post by:
Can any one help me in finding the test suite (test C++ examples) for testing the C++ parser.
7
3125
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 result. Especially, I want to know the compiler conformance of vc7.1, vc8.0, gcc 4.x and intel c++, and also each implementation of STL. The world is moving on, right? :)
6
1182
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 kinds, 2d & 3d). I am also looking for something that does not require vs.net and that I can code with a text editor instead. It also needs to run on .net 1.1+. Any suggestions? I am currently looking into Infragistics.. thanks
5
2519
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 // --- begin code ---
17
2537
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 should probably be several of them (with some commonality), one each for C90, C99, and C0X. The tests should be clearly tied to the standard. There are several classes of tests needed, i.e. conformance, detection of errors, and quality. The last...
176
8536
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 their own unit test framework, and then in a lab session see if I can get them to write their own. To give them an example I've created the following UTF class (with a simple test program following). I would welcome and suggestions on how anybody...
48
2531
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 from what limited exposure I've had, they are pricey, reasonably buggy, and require compiler/target adaptation. Out of my frustration with two out of two of them came my own. Its instrumentation approach is based solely on profound abuse of the C
2
2039
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
9799
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11172
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...
1
10871
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9592
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...
1
7987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5808
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4235
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3245
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.