Using the unittest module

| | Comments (0) | TrackBacks (0)

Which unittest module should I use for tests in the application?

The Problem: When developing unit-tests for the application, there is several modules to use. Currently there are the options: unittest (from python), coilib50.unittest, xgui20.unittest and sci20.unittest. Which one should we use and how to use them?

The Solution:

  • Always use ONLY the module of the higher level library.
  • Import the module using the syntax: from XXX import unittest
  • Inside the code, use the unittest. prefix for all unittest symbols

Remarks:

  • All unittest module have main and all unittest related symbols defined. This means that the unittest module for sci20, for example, also have the lower level symbols such as TestCase, GUITestCase and main

Categories

Leave a comment