Package pysys :: Package unit :: Module pyunit :: Class PyUnitTest
[hide private]
[frames] | no frames]

Class PyUnitTest

source code

process.user.ProcessUser --+    
                           |    
           basetest.BaseTest --+
                               |
                              PyUnitTest

Class for running PyUnit tests (standard Python unittest module). The execute method will execute all the .py files, find all the unittest.TestCase classes within those files and run the test methods within them. A separate Python process will be spawned for each input test file. By default child Python processes will have the same PYTHONPATH as the python process which is running pysys. However, this can be changed by overriding the getPythonPath() method.

Instance Methods [hide private]
 
execute(self)
Implementation of the execute() abstract method which simply calls executePyUnitTests()
source code
 
executePyUnitTests(self)
Run all the PyUnit tests in the Input directory.
source code
 
_findPythonFiles(self) source code
 
_runTestFile(self, testFile) source code
 
getPythonPath(self)
Override this method to return a sequence of paths to put at the beginning of the PYTHONPATH when running the PyUnit tests.
source code

Inherited from basetest.BaseTest: __init__, addOutcome, addResource, assertDiff, assertFalse, assertGrep, assertLastGrep, assertLineCount, assertOrderedGrep, assertTrue, cleanup, getNextAvailableTCPPort, getOutcome, setKeywordArgs, setup, signalProcess, startManualTester, startProcess, startProcessMonitor, stopManualTester, stopProcess, stopProcessMonitor, validate, wait, waitManualTester, waitProcess

Inherited from process.user.ProcessUser: __del__, __getattr__, getInstanceCount, waitForFile, waitForSignal, waitForSocket, writeProcess

Instance Variables [hide private]

Inherited from basetest.BaseTest: input, log, mode, output, project, reference

Method Details [hide private]

execute(self)

source code 

Implementation of the execute() abstract method which simply calls executePyUnitTests()

Raises:
  • NotImplementedError - Raised exeception should the method not be overridden
Overrides: basetest.BaseTest.execute

getPythonPath(self)

source code 

Override this method to return a sequence of paths to put at the beginning of the PYTHONPATH when running the PyUnit tests. See PyUnit_test_002 for an example of this.