class documentation

class _DeprecationTestCase:

Known subclasses: numpy.core.tests.test_deprecations._VisibleDeprecationTestCase, 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.Test_UPDATEIFCOPY, numpy.core.tests.test_deprecations.TestAlen, numpy.core.tests.test_deprecations.TestArrayDataAttributeAssignmentDeprecation, numpy.core.tests.test_deprecations.TestBinaryReprInsufficientWidthParameterForRepresentation, numpy.core.tests.test_deprecations.TestBincount, numpy.core.tests.test_deprecations.TestComparisonBadDType, numpy.core.tests.test_deprecations.TestComparisonBadObjectDType, 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.TestMachAr, numpy.core.tests.test_deprecations.TestMatrixInOuter, numpy.core.tests.test_deprecations.TestNonCContiguousViewDeprecation, 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.TestQuantileInterpolationDeprecation, numpy.core.tests.test_deprecations.TestRaggedArray, numpy.core.tests.test_deprecations.TestShape1Fields, numpy.core.tests.test_deprecations.TestSingleElementSignature, numpy.core.tests.test_deprecations.TestSpecialAttributeLookupFailure, numpy.core.tests.test_deprecations.TestToString, numpy.core.tests.test_deprecations.TestTruthTestingEmptyArrays, numpy.core.tests.test_deprecations.TestUFuncForcedDTypeWarning

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 Undocumented
Method teardown 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={}):

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 : callable
The function to test
num : int
Number of DeprecationWarnings to expect. This should normally be 1.
ignore_others : bool
Whether warnings of the wrong type should be ignored (note that the message is not checked)
function_fails : bool
If the function would normally fail, setting this will check for warnings inside a try/except block.
exceptions : Exception or tuple of Exceptions
Exception 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 : tuple
Arguments for function
kwargs : dict
Keyword arguments for function
def assert_not_deprecated(self, function, args=(), kwargs={}):

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(self):

Undocumented

def teardown(self):

Undocumented

message: str =
log =

Undocumented

warn_ctx =

Undocumented