Active Topics Memberlist Calendar Search Help | |
Register Login |
One Stop Testing Forum : Software Testing @ OneStopTesting : Test Cases @ OneStopTesting |
Topic: Writing Unit Tests for the test package |
|
Author | Message |
tanushree
Senior Member Joined: 04Apr2007 Online Status: Offline Posts: 2160 |
Topic: Writing Unit Tests for the test package Posted: 29Oct2007 at 3:30am |
It is preferred that tests for the test package use the unittest module and follow a few guidelines. One is to name the test module by starting it with "test_" and end it with the name of the module being tested. The test methods in the test module should start with "test_" and end with a description of what the method is testing. This is needed so that the methods are recognized by the test driver as test methods. Also, no documentation string for the method should be included. A comment (such as "# Tests function returns only True or False") should be used to provide documentation for test methods. This is done because documentation strings get printed out if they exist and thus what test is being run is not stated. A basic boilerplate is often used:
import unittest This boilerplate code allows the testing suite to be run by test.regrtest as well as on its own as a script. The goal for regression testing is to try to break code. This leads to a few guidelines to be followed:
See Also: Post Resume: Click here to Upload your Resume & Apply for Jobs |
|
IP Logged | |
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
© Vyom Technosoft Pvt. Ltd. All Rights Reserved.