lsst.sconsUtils  13.0-7-gc601e82+1
Public Member Functions | Public Attributes | List of all members
lsst.sconsUtils.tests.Control Class Reference

A class to control unit tests. More...

Inheritance diagram for lsst.sconsUtils.tests.Control:

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)
 

Public Attributes

 runExamples
 

Detailed Description

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().

Constructor & Destructor Documentation

◆ __init__()

def lsst.sconsUtils.tests.Control.__init__ (   self,
  env,
  ignoreList = None,
  expectedFailures = None,
  args = None,
  tmpDir = ".tests",
  verbose = False 
)

Create an object to run tests.

Parameters
envAn SCons Environment (almost always lsst.sconsUtils.env).
ignoreListA 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).
expectedFaluresA dictionary; the keys are tests that are known to fail; the values are strings to print.
argsA 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:".
tmpDirThe location of the test outputs.
verboseHow chatty you want the test code to be.
tests = lsst.tests.Control(
env,
args={
"MaskIO_1" : "data/871034p_1_MI_msk.fits",
"MaskedImage_1" : "file:data/871034p_1_MI foo",
},
ignoreList=["Measure_1"],
expectedFailures={"BBox_1": "Problem with single-pixel BBox"}
)

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, and lsst.sconsUtils.tests.Control._verbose.

Member Function Documentation

◆ args()

def lsst.sconsUtils.tests.Control.args (   self,
  test 
)

References lsst.sconsUtils.tests.Control._args.

Referenced by lsst.sconsUtils.tests.Control.run().

◆ ignore()

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().

◆ messages()

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().

◆ run()

def lsst.sconsUtils.tests.Control.run (   self,
  fileGlob 
)

References lsst.sconsUtils.tests.Control._cwd, lsst.sconsUtils.tests.Control._env, lsst.sconsUtils.tests.Control._tmpDir, lsst.sconsUtils.tests.Control.args(), lsst.sconsUtils.tests.Control.ignore(), lsst.sconsUtils.tests.Control.messages(), and lsst.sconsUtils.tests.Control.runExamples.

Member Data Documentation

◆ runExamples

lsst.sconsUtils.tests.Control.runExamples

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