|
def | init () |
|
def | run (suite, exit=True) |
| Exit with the status code resulting from running the provided test suite. More...
|
|
def | sort_tests (tests) |
| Go through the supplied sequence of test suites and sort them to ensure that MemoryTestCases are at the end of the test list. More...
|
|
def | suiteClassWrapper (tests) |
|
def | findFileFromRoot (ifile) |
| Find file which is specified as a path relative to the toplevel directory; we start in $cwd and walk up until we find the file (or throw IOError if it doesn't exist) More...
|
|
def | getTempFilePath (ext) |
| Return a path suitable for a temporary file and try to delete the file on success. More...
|
|
def | inTestCase (func) |
| A decorator to add a free function to our custom TestCase class, while also making it available as a free function. More...
|
|
def | assertRaisesLsstCpp (testcase, excClass, callableObj, args, kwargs) |
|
def | debugger (exceptions) |
| Decorator to enter the debugger when there's an uncaught exception. More...
|
|
def | plotImageDiff (lhs, rhs, bad=None, diff=None, plotFileName=None) |
| Plot the comparison of two 2-d NumPy arrays. More...
|
|
def | assertFloatsAlmostEqual (testCase, lhs, rhs, rtol=sys.float_info.epsilon, atol=sys.float_info.epsilon, relTo=None, printFailures=True, plotOnFailure=False, plotFileName=None, invert=False, msg=None) |
| Highly-configurable floating point comparisons for scalars and arrays. More...
|
|
def | assertFloatsNotEqual (testCase, lhs, rhs, kwds) |
|
def | assertFloatsEqual (testCase, lhs, rhs, kwargs) |
|
def | assertClose (args, kwargs) |
|
def | assertNotClose (args, kwargs) |
|
def lsst.utils.tests.assertFloatsAlmostEqual |
( |
|
testCase, |
|
|
|
lhs, |
|
|
|
rhs, |
|
|
|
rtol = sys.float_info.epsilon , |
|
|
|
atol = sys.float_info.epsilon , |
|
|
|
relTo = None , |
|
|
|
printFailures = True , |
|
|
|
plotOnFailure = False , |
|
|
|
plotFileName = None , |
|
|
|
invert = False , |
|
|
|
msg = None |
|
) |
| |
Highly-configurable floating point comparisons for scalars and arrays.
The test assertion will fail if all elements lhs and rhs are not equal to within the tolerances specified by rtol and atol. More precisely, the comparison is:
abs(lhs - rhs) <= relTo*rtol OR abs(lhs - rhs) <= atol
If rtol or atol is None, that term in the comparison is not performed at all.
When not specified, relTo is the elementwise maximum of the absolute values of lhs and rhs. If set manually, it should usually be set to either lhs or rhs, or a scalar value typical of what is expected.
- Parameters
-
[in] | testCase | unittest.TestCase instance the test is part of |
[in] | lhs | LHS value(s) to compare; may be a scalar or array-like of any dimension |
[in] | rhs | RHS value(s) to compare; may be a scalar or array-like of any dimension |
[in] | rtol | Relative tolerance for comparison; defaults to double-precision epsilon. |
[in] | atol | Absolute tolerance for comparison; defaults to double-precision epsilon. |
[in] | relTo | Value to which comparison with rtol is relative. |
[in] | printFailures | Upon failure, print all inequal elements as part of the message. |
[in] | plotOnFailure | Upon failure, plot the originals and their residual with matplotlib. Only 2-d arrays are supported. |
[in] | plotFileName | Filename to save the plot to. If None, the plot will be displayed in a a window. |
[in] | invert | If True, invert the comparison and fail only if any elements are equal. Used to implement assertFloatsNotEqual, which should generally be used instead for clarity. |
[in] | msg | String to append to the error message when assert fails. |
Definition at line 522 of file tests.py.
def lsst.utils.tests.debugger |
( |
|
exceptions | ) |
|