TestPDHandler#
- class TestPDHandler(methodName='runTest')[source]#
Bases:
DefermiTestCreate an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
Methods
addClassCleanupSame as addCleanup, except the cleanup items are called even if setUpClass fails (unlike tearDownClass).
addCleanupAdd a function, with arguments, to be called when the test is completed.
addTypeEqualityFuncAdd a type specific assertEqual style function to compare a type.
assertAlmostEqualFail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is more than the given delta.
assertAlmostEqualsassertCountEqualAsserts that two iterables have the same elements, the same number of times, without regard to order.
assertDictContainsSubsetChecks whether dictionary is a superset of subset.
assertDictEqualassertEqualFail if the two objects are unequal as determined by the '==' operator.
assertEqualsassertFalseCheck that the expression is false.
assertGreaterJust like self.assertTrue(a > b), but with a nicer default message.
assertGreaterEqualJust like self.assertTrue(a >= b), but with a nicer default message.
assertInJust like self.assertTrue(a in b), but with a nicer default message.
assertIsJust like self.assertTrue(a is b), but with a nicer default message.
assertIsInstanceSame as self.assertTrue(isinstance(obj, cls)), with a nicer default message.
assertIsNoneSame as self.assertTrue(obj is None), with a nicer default message.
assertIsNotJust like self.assertTrue(a is not b), but with a nicer default message.
assertIsNotNoneIncluded for symmetry with assertIsNone.
assertLessJust like self.assertTrue(a < b), but with a nicer default message.
assertLessEqualJust like self.assertTrue(a <= b), but with a nicer default message.
assertListEqualA list-specific equality assertion.
assertLogsFail unless a log message of level level or higher is emitted on logger_name or its children.
assertMultiLineEqualAssert that two multi-line strings are equal.
assertNoLogsFail unless no log messages of level level or higher are emitted on logger_name or its children.
assertNotAlmostEqualFail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is less than the given delta.
assertNotAlmostEqualsassertNotEqualFail if the two objects are equal as determined by the '!=' operator.
assertNotEqualsassertNotInJust like self.assertTrue(a not in b), but with a nicer default message.
assertNotIsInstanceIncluded for symmetry with assertIsInstance.
assertNotRegexFail the test if the text matches the regular expression.
assertNotRegexpMatchesassertRaisesFail unless an exception of class expected_exception is raised by the callable when invoked with specified positional and keyword arguments.
assertRaisesRegexAsserts that the message in a raised exception matches a regex.
assertRaisesRegexpassertRegexFail the test unless the text matches the regular expression.
assertRegexpMatchesassertSequenceEqualAn equality assertion for ordered sequences (like lists and tuples).
assertSetEqualA set-specific equality assertion.
assertTrueCheck that the expression is true.
assertTupleEqualA tuple-specific equality assertion.
assertWarnsFail unless a warning of class warnClass is triggered by the callable when invoked with specified positional and keyword arguments.
assertWarnsRegexAsserts that the message in a triggered warning matches a regexp.
assert_assert_all_closeTests if two arrays are almost equal up to some relative or absolute tolerance.
assert_object_almost_equalCustom assertion function to check if two objects are almost equal.
assert_str_content_equalTests if two strings are equal, ignoring things like trailing spaces, etc.
countTestCasesdebugRun the test without collecting errors in a TestResult
defaultTestResultdoClassCleanupsExecute all class cleanup functions.
doCleanupsExecute all cleanup functions.
enterClassContextSame as enterContext, but class-wide.
enterContextEnters the supplied context manager.
failFail immediately, with the given message.
failIffailIfAlmostEqualfailIfEqualfailUnlessfailUnlessAlmostEqualfailUnlessEqualfailUnlessRaisesget_testfile_pathidrunHook method for setting up the test fixture before exercising it.
setUpClassHook method for setting up class fixture before running tests in the class.
shortDescriptionReturns a one-line description of the test, or None if no description has been provided.
skipTestSkip this test.
subTestReturn a context manager that will return the enclosed block of code in a subtest identified by the optional message and keyword parameters.
tearDownHook method for deconstructing the test fixture after testing it.
tearDownClassHook method for deconstructing the class fixture after running all tests in the class.
Attributes
longMessagemaxDiffstructuretest_files_pathPath with test files ("./test_files")