nose: nose.case
nose unittest.TestCase subclasses. It is not necessary to subclass these classes when writing tests; they are used internally by nose.loader.TestLoader to create test cases from test functions and methods in test classes.
Classes
Highlighted methods are defined in this class.
The universal test case wrapper.
When a plugin sees a test, it will always see an instance of this class. To access the actual test case that will be run, access the test property of the nose.case.Test instance.
Methods
Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed.
Return a round-trip name for this test, a name that can be fed back as input to loadTestByName and (assuming the same plugin configuration) result in the loading of this test.
Called before test is run (before result.startTest)
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail if the two objects are unequal as determined by the '==' operator.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail if the two objects are equal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Fail the test unless the expression is true.
Fail the test unless the expression is true.
Called after test is complete (after result.stopTest)
Run the test without collecting errors in a TestResult
Extract exception info.
Fail immediately, with the given message.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail the test unless the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Get a short(er) description of the test
Modified run for the test wrapper.
From here we don't call result.startTest or stopTest or addSuccess. The wrapper calls addError/addFailure only if its own setup or teardown fails, or running the wrapped test fails (eg, if the wrapped "test" is not callable).
Two additional methods are called, beforeTest and afterTest. These give plugins a chance to modify the wrapped test before it is called and do cleanup after it is called. They are called unconditionally.
Run the test. Plugins may alter the test by returning a value from prepareTestCase. The value must be callable and must accept one argument, the result instance.
Hook method for setting up the test fixture before exercising it.
Hook method for deconstructing the test fixture after testing it.
Attributes
Default value: (property)
Get the context object of this test (if any).
Methods
Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail if the two objects are unequal as determined by the '==' operator.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail if the two objects are equal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Fail the test unless the expression is true.
Fail the test unless the expression is true.
Run the test without collecting errors in a TestResult
Fail immediately, with the given message.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail the test unless the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Hook method for setting up the test fixture before exercising it.
Returns a one-line description of the test, or None if no description has been provided.
The default implementation of this method returns the first line of the specified test method's docstring.
Hook method for deconstructing the test fixture after testing it.
Common functionality for FunctionTestCase and MethodTestCase.
Methods
Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed.
Create 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.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail if the two objects are unequal as determined by the '==' operator.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail if the two objects are equal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Fail the test unless the expression is true.
Fail the test unless the expression is true.
Run the test without collecting errors in a TestResult
Fail immediately, with the given message.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail the test unless the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Hook method for setting up the test fixture before exercising it.
Hook method for deconstructing the test fixture after testing it.
Test case wrapper for test methods.
Don't use this class directly; it is used internally in nose to create test cases for test methods.
Methods
Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed.
Initialize the MethodTestCase.
Required argument:
- method -- the method to call, may be bound or unbound. In either case, a new instance of the method's class will be instantiated to make the call.
Optional arguments:
- test -- the test function to call. If this is passed, it will be called instead of getting a new bound method of the same name as the desired method from the test instance. This is to support generator methods that yield inline functions.
- arg -- arguments to pass to the test function. This is to support generator methods that yield arguments.
- descriptor -- the function, other than the test, that should be used to construct the test name. This is to support generator methods.
Get the descriptors of the test method: the method and arguments that will be used to construct the test name. In most cases, this is the method itself and no arguments. For tests generated by generator methods, the original (generator) method and args passed to the generated method or function are returned.
Return a round-trip name for this test, a name that can be fed back as input to loadTestByName and (assuming the same plugin configuration) result in the loading of this test.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail if the two objects are unequal as determined by the '==' operator.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail if the two objects are equal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Fail the test unless the expression is true.
Fail the test unless the expression is true.
Run the test without collecting errors in a TestResult
Fail immediately, with the given message.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail the test unless the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Attributes
Default value: (property)
Get context (class) of this test
TestCase wrapper for test functions.
Don't use this class directly; it is used internally in nose to create test cases for test functions.
Methods
Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed.
Initialize the MethodTestCase.
Required argument:
- test -- the test function to call.
Optional arguments:
- setUp -- function to run at setup.
- tearDown -- function to run at teardown.
- arg -- arguments to pass to the test function. This is to support generator functions that yield arguments.
- descriptor -- the function, other than the test, that should be used to construct the test name. This is to support generator functions.
Get the descriptors of the test function: the function and arguments that will be used to construct the test name. In most cases, this is the function itself and no arguments. For tests generated by generator functions, the original (generator) function and args passed to the generated function are returned.
Return a round-trip name for this test, a name that can be fed back as input to loadTestByName and (assuming the same plugin configuration) result in the loading of this test.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail if the two objects are unequal as determined by the '==' operator.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail if the two objects are equal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Fail the test unless the expression is true.
Fail the test unless the expression is true.
Run the test without collecting errors in a TestResult
Fail immediately, with the given message.
Fail the test if the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are equal as determined by the '==' operator.
Fail the test unless the expression is true.
Fail 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.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).
Fail if the two objects are unequal as determined by the '==' operator.
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
Run any setup function attached to the test function
Run any teardown function attached to the test function
Attributes
Default value: (property)
Get context (module) of this test