lsst.sconsUtils
16.0-14-g280d363+1
|
A class to control unit tests. More...
Public Member Functions | |
def | __init__ (self, env, ignoreList=None, expectedFailures=None, args=None, tmpDir=".tests", verbose=False) |
Create an object to run tests. More... | |
def | args (self, test) |
def | ignore (self, test) |
def | messages (self, test) |
def | run (self, fileGlob) |
def | runPythonTests (self, pyList) |
def | junitPrefix (self) |
Public Attributes | |
runExamples | |
A class to control unit tests.
This class is unchanged from previous versions of sconsUtils, but it will now generally be called via scripts.BasicSConscript.tests().
def lsst.sconsUtils.tests.Control.__init__ | ( | self, | |
env, | |||
ignoreList = None , |
|||
expectedFailures = None , |
|||
args = None , |
|||
tmpDir = ".tests" , |
|||
verbose = False |
|||
) |
Create an object to run tests.
env | An SCons Environment (almost always lsst.sconsUtils.env). |
ignoreList | A list of tests that should NOT be run — useful in conjunction with glob patterns. If a file is listed as "@fileName", the @ is stripped and we don't bother to check if fileName exists (useful for machine-generated files). |
expectedFalures | A dictionary; the keys are tests that are known to fail; the values are strings to print. |
args | A dictionary with testnames as keys, and argument strings as values. As scons always runs from the top-level directory, tests has to fiddle with paths. If an argument is a file this is done automatically; if it's e.g. just a basename then you have to tell tests that it's really (part of a) filename by prefixing the name by "file:". |
tmpDir | The location of the test outputs. |
verbose | How chatty you want the test code to be. |
References lsst.sconsUtils.tests.Control._args, lsst.sconsUtils.tests.Control._cwd, lsst.sconsUtils.tests.Control._env, lsst.sconsUtils.tests.Control._EXPECT_FAILURE, lsst.sconsUtils.tests.Control._IGNORE, lsst.sconsUtils.tests.Control._info, lsst.sconsUtils.tests.Control._tmpDir, lsst.sconsUtils.tests.Control._tmpDirAbs, and lsst.sconsUtils.tests.Control._verbose.
def lsst.sconsUtils.tests.Control.args | ( | self, | |
test | |||
) |
References lsst.sconsUtils.tests.Control._args.
Referenced by lsst.sconsUtils.tests.Control.run().
def lsst.sconsUtils.tests.Control.ignore | ( | self, | |
test | |||
) |
References lsst.sconsUtils.tests.Control._env, lsst.sconsUtils.tests.Control._IGNORE, lsst.sconsUtils.tests.Control._info, and lsst.sconsUtils.tests.Control._verbose.
Referenced by lsst.sconsUtils.tests.Control.run(), and lsst.sconsUtils.tests.Control.runPythonTests().
def lsst.sconsUtils.tests.Control.junitPrefix | ( | self | ) |
References lsst.sconsUtils.tests.Control._env, and lsst.sconsUtils.tests.Control._tmpDirAbs.
Referenced by lsst.sconsUtils.tests.Control.run(), and lsst.sconsUtils.tests.Control.runPythonTests().
def lsst.sconsUtils.tests.Control.messages | ( | self, | |
test | |||
) |
Return the messages to be used in case of success/failure; the logicals (note that they are strings) tell whether the test is expected to pass
References lsst.sconsUtils.tests.Control._EXPECT_FAILURE, and lsst.sconsUtils.tests.Control._info.
Referenced by lsst.sconsUtils.tests.Control.run().
def lsst.sconsUtils.tests.Control.run | ( | self, | |
fileGlob | |||
) |
Create a test target for each file matching the supplied glob.
References lsst.sconsUtils.tests.Control._cwd, lsst.sconsUtils.tests.Control._env, lsst.sconsUtils.tests.Control._getPytestCoverageCommand(), lsst.sconsUtils.tests.Control._tmpDir, lsst.sconsUtils.tests.Control.args(), lsst.sconsUtils.tests.Control.ignore(), lsst.sconsUtils.tests.Control.junitPrefix(), lsst.sconsUtils.tests.Control.messages(), and lsst.sconsUtils.tests.Control.runExamples.
def lsst.sconsUtils.tests.Control.runPythonTests | ( | self, | |
pyList | |||
) |
Add a single target for testing all python files. pyList is a list of nodes corresponding to python test files. The IgnoreList is respected when scanning for entries. If pyList is None, or an empty list, it uses automated test discovery within pytest. This differs from the behavior of scripts.tests() where a distinction is made. Returns a list containing a single target.
References lsst.sconsUtils.tests.Control._cwd, lsst.sconsUtils.tests.Control._env, lsst.sconsUtils.tests.Control._getPytestCoverageCommand(), lsst.sconsUtils.tests.Control._tmpDir, lsst.sconsUtils.tests.Control.ignore(), and lsst.sconsUtils.tests.Control.junitPrefix().
lsst.sconsUtils.tests.Control.runExamples |
Referenced by lsst.sconsUtils.tests.Control.run().