class documentation

class _DeprecationTestCase: (source)

Known subclasses: numpy.core.tests.test_deprecations.BuiltInRoundComplexDType, numpy.core.tests.test_deprecations.FlatteningConcatenateUnsafeCast, numpy.core.tests.test_deprecations.Test_GetSet_NumericOps, numpy.core.tests.test_deprecations.TestArrayDataAttributeAssignmentDeprecation, numpy.core.tests.test_deprecations.TestArrayFinalizeNone, numpy.core.tests.test_deprecations.TestAxisNotMAXDIMS, numpy.core.tests.test_deprecations.TestBinaryReprInsufficientWidthParameterForRepresentation, numpy.core.tests.test_deprecations.TestBincount, numpy.core.tests.test_deprecations.TestComparisonDeprecations, numpy.core.tests.test_deprecations.TestCtypesGetter, numpy.core.tests.test_deprecations.TestDatetime64Timezone, numpy.core.tests.test_deprecations.TestDatetimeEvent, numpy.core.tests.test_deprecations.TestDeprecatedGlobals, numpy.core.tests.test_deprecations.TestDeprecatedUnpickleObjectScalar, numpy.core.tests.test_deprecations.TestDeprecateSubarrayDTypeDuringArrayCoercion, numpy.core.tests.test_deprecations.TestDTypeAttributeIsDTypeDeprecation, numpy.core.tests.test_deprecations.TestDTypeCoercion, numpy.core.tests.test_deprecations.TestFromstring, numpy.core.tests.test_deprecations.TestFromStringAndFileInvalidData, numpy.core.tests.test_deprecations.TestFutureWarningArrayLikeNotIterable, numpy.core.tests.test_deprecations.TestGeneratorSum, numpy.core.tests.test_deprecations.TestIncorrectAdvancedIndexWithEmptyResult, numpy.core.tests.test_deprecations.TestLoadtxtParseIntsViaFloat, numpy.core.tests.test_deprecations.TestMachAr, numpy.core.tests.test_deprecations.TestMatrixInOuter, numpy.core.tests.test_deprecations.TestMemEventHook, numpy.core.tests.test_deprecations.TestNonExactMatchDeprecation, numpy.core.tests.test_deprecations.TestNonNumericConjugate, numpy.core.tests.test_deprecations.TestNonZero, numpy.core.tests.test_deprecations.TestNoseDecoratorsDeprecated, numpy.core.tests.test_deprecations.TestNPY_CHAR, numpy.core.tests.test_deprecations.TestPartitionBoolIndex, numpy.core.tests.test_deprecations.TestPositiveOnNonNumerical, numpy.core.tests.test_deprecations.TestPyArray_AS1D, numpy.core.tests.test_deprecations.TestPyArray_AS2D, numpy.core.tests.test_deprecations.TestPyIntConversion, numpy.core.tests.test_deprecations.TestQuantileInterpolationDeprecation, numpy.core.tests.test_deprecations.TestShape1Fields, numpy.core.tests.test_deprecations.TestSingleElementSignature, numpy.core.tests.test_deprecations.TestToString, numpy.core.tests.test_deprecations.TestTruthTestingEmptyArrays, numpy.core.tests.test_deprecations._VisibleDeprecationTestCase

View In Hierarchy

Undocumented

Method assert_deprecated Test if DeprecationWarnings are given and raised.
Method assert_not_deprecated Test that warnings are not raised.
Method setup_method Undocumented
Method teardown_method Undocumented
Class Variable message Undocumented
Instance Variable log Undocumented
Instance Variable warn_ctx Undocumented
def assert_deprecated(self, function, num=1, ignore_others=False, function_fails=False, exceptions=np._NoValue, args=(), kwargs={}): (source)

Test if DeprecationWarnings are given and raised.

This first checks if the function when called gives num DeprecationWarnings, after that it tries to raise these DeprecationWarnings and compares them with exceptions. The exceptions can be different for cases where this code path is simply not anticipated and the exception is replaced.

Parameters
function:callableThe function to test
num:intNumber of DeprecationWarnings to expect. This should normally be 1.
ignore_others:boolWhether warnings of the wrong type should be ignored (note that the message is not checked)
function_fails:boolIf the function would normally fail, setting this will check for warnings inside a try/except block.
exceptions:Exception or tuple of ExceptionsException to expect when turning the warnings into an error. The default checks for DeprecationWarnings. If exceptions is empty the function is expected to run successfully.
args:tupleArguments for function
kwargs:dictKeyword arguments for function
def assert_not_deprecated(self, function, args=(), kwargs={}): (source)

Test that warnings are not raised.

This is just a shorthand for:

self.assert_deprecated(function, num=0, ignore_others=True,
exceptions=tuple(), args=args, kwargs=kwargs)
def setup_method(self): (source)

Undocumented

def teardown_method(self): (source)

Undocumented

Undocumented

warn_ctx = (source)

Undocumented