Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
TestSuite Class Reference

Public Member Functions

def __init__
 
def __repr__
 
def countTestCases
 
def addTest
 
def addTests
 
def run
 
def __call__
 
def debug
 

Detailed Description

A test suite is a composite test consisting of a number of TestCases.

For use, create an instance of TestSuite, then add test case instances.
When all tests have been added, the suite can be passed to a test
runner, such as TextTestRunner. It will run the individual test cases
in the order in which they were added, aggregating the results. When
subclassing, do not forget to call the base class constructor.

Definition at line 307 of file unittest.py.

Constructor & Destructor Documentation

def __init__ (   self,
  tests = () 
)

Definition at line 316 of file unittest.py.

References TestSuite._tests, and TestSuite.addTests().

317  def __init__(self, tests=()):
318  self._tests = []
319  self.addTests(tests)

Member Function Documentation

def __call__ (   self,
  result 
)

Definition at line 341 of file unittest.py.

References TestSuite._tests, and symbol.test.

342  def __call__(self, result):
343  for test in self._tests:
344  if result.shouldStop:
345  break
346  test(result)
347  return result
def __repr__ (   self)

Definition at line 320 of file unittest.py.

References SymbolTable.__class__, and TestSuite._tests.

321  def __repr__(self):
322  return "<%s tests=%s>" % (self.__class__, self._tests)
def addTest (   self,
  test 
)

Definition at line 331 of file unittest.py.

332  def addTest(self, test):
333  self._tests.append(test)
def addTests (   self,
  tests 
)

Definition at line 334 of file unittest.py.

References TestSuite.addTest().

335  def addTests(self, tests):
336  for test in tests:
337  self.addTest(test)
def countTestCases (   self)

Definition at line 325 of file unittest.py.

References TestSuite._tests.

326  def countTestCases(self):
327  cases = 0
328  for test in self._tests:
329  cases = cases + test.countTestCases()
330  return cases
def debug (   self)
Run the tests without collecting errors in a TestResult

Definition at line 348 of file unittest.py.

References TestSuite._tests.

349  def debug(self):
350  """Run the tests without collecting errors in a TestResult"""
351  for test in self._tests: test.debug()
352 
def run (   self,
  result 
)

Definition at line 338 of file unittest.py.

339  def run(self, result):
340  return self(result)

The documentation for this class was generated from the following file: