tests.tools_deprecate_tests module#

Tests for deprecation tools.

class tests.tools_deprecate_tests.DecoratorFullNameTestCase(*args, **kwargs)[source]#

Bases: DisableSiteMixin, DeprecationTestCase

Class with methods deprecated.

abstract_class = False#
test_add_full_name_decorator()[source]#

Test add_decorated_full_name() method.

tests.tools_deprecate_tests.DeprecatedClass(foo=None)[source]#

Deprecated.

Deprecated class.

tests.tools_deprecate_tests.DeprecatedClassNoInit()[source]#

Deprecated.

Deprecated class.

class tests.tools_deprecate_tests.DeprecatedMethodClass[source]#

Bases: object

Class with methods deprecated.

classmethod class_method(foo=None)[source]#

Deprecated.

Deprecated class method.

deprecated_all()[source]#

Deprecating positional parameters.

deprecated_all2(foo)[source]#

Deprecating last positional parameter.

deprecated_instance_method_and_arg(foo, bah='[deprecated name of foo]')[source]#

Deprecated.

Deprecated instance method with deprecated parameters.

deprecated_instance_method_and_arg2(foo, bah='[deprecated name of foo]')[source]#

Deprecated.

Deprecating decorators in reverse order.

deprecated_instance_method_arg(foo=None, bah='[deprecated name of foo]')[source]#

Instance method with deprecated parameters.

deprecated_instance_method_args(foo, foo2, foo3=None, foo4=None, bah4='[deprecated name of foo4]', bah3='[deprecated name of foo3]', bah2='[deprecated name of foo2]', bah='[deprecated name of foo]')[source]#

Method with many decorators to verify wrapping depth formula.

deprecated_instance_method_args_multi(foo, foo2, bah='[deprecated name of foo]', bah2='[deprecated name of foo2]')[source]#

Instance method with multiple deprecated parameters.

instance_method(foo=None)[source]#

Deprecated.

Deprecated instance method.

instance_method2(foo=None)[source]#

Deprecated.

Another deprecated instance method.

static static_method(foo=None)[source]#

Deprecated.

Deprecated static method.

undecorated_method(foo=None)[source]#

Not deprecated instance method.

class tests.tools_deprecate_tests.DeprecatorTestCase(*args, **kwargs)[source]#

Bases: DisableSiteMixin, DeprecationTestCase

Test cases for deprecation tools.

abstract_class = False#
test_deprecate_and_remove_function_args()[source]#

Test @deprecated and removed function argument.

test_deprecate_class()[source]#

Test @deprecated with classes.

test_deprecate_class_zero_arg()[source]#

Test @deprecated with classes, without arguments.

test_deprecate_function_arg()[source]#

Test @deprecated function argument.

test_deprecated_class_method()[source]#

Test @deprecated with class methods.

test_deprecated_function()[source]#

Test @deprecated with functions.

test_deprecated_function2()[source]#

Test @deprecated with functions.

test_deprecated_function_bad_args()[source]#

Test @deprecated function with bad arguments.

test_deprecated_function_docstring()[source]#

Test @deprecated docstring modification.

test_deprecated_function_instead()[source]#

Test @deprecated with functions, using instead.

test_deprecated_function_multiline_docstring()[source]#

Test @deprecated docstring modification on multiline docstring.

Python 3.13 strips the doc string, see https://docs.python.org/3.13/whatsnew/3.13.html#other-language-changes

test_deprecated_function_zero_arg()[source]#

Test @deprecated with functions, with zero arguments.

test_deprecated_instance_method()[source]#

Test @deprecated instance method.

test_deprecated_instance_method2()[source]#

Test @deprecated instance method 2.

test_deprecated_instance_method_and_arg()[source]#

Test @deprecate_arg and @deprecated with instance methods.

test_deprecated_instance_method_and_arg2()[source]#

Test @deprecated and @deprecate_arg with instance methods.

test_deprecated_instance_method_arg()[source]#

Test @deprecate_arg with instance methods.

test_deprecated_instance_method_args()[source]#

Test @deprecate_arg with instance methods and two args.

test_deprecated_instance_method_args_multi()[source]#

Test @deprecated_args with instance methods and two args.

test_deprecated_instance_method_zero_arg()[source]#

Test @deprecate_arg with classes, without arguments.

test_deprecated_static_method()[source]#

Test @deprecated with static methods.

test_deprecated_static_method_zero_args()[source]#

Test @deprecated with static methods, with zero arguments.

test_function_remove_last_args()[source]#

Test @remove_last_args on functions.

test_method_remove_last_args()[source]#

Test @remove_last_args on functions.

test_remove_last_args_invalid()[source]#

Test invalid @remove_last_args on functions.

tests.tools_deprecate_tests.decorated_func(*args, **kwargs)[source]#
tests.tools_deprecate_tests.decorated_func2(*args, **kwargs)[source]#
tests.tools_deprecate_tests.decorated_func3(*args, **kwargs)[source]#
tests.tools_deprecate_tests.deprecated_all()[source]#

Test remove_last_args with all args removed.

tests.tools_deprecate_tests.deprecated_all2(foo)[source]#

Test remove_last_args with one arg removed.

tests.tools_deprecate_tests.deprecated_func(foo=None)[source]#

Deprecated.

Deprecated function.

tests.tools_deprecate_tests.deprecated_func2(foo=None)[source]#

Deprecated.

Deprecated function.

tests.tools_deprecate_tests.deprecated_func2_docstring(foo=None)[source]#

DEPRECATED, don’t use this. Deprecated function.

tests.tools_deprecate_tests.deprecated_func_arg(foo=None, bah='[deprecated name of foo]')[source]#

Deprecated arg ‘bah’.

tests.tools_deprecate_tests.deprecated_func_arg2(foo=None, bah='[deprecated name of foo]')[source]#

Test deprecated_args with one rename.

tests.tools_deprecate_tests.deprecated_func_arg3(foo=None, bah='[deprecated name of foo]', silent=NotImplemented, loud=NotImplemented, old=NotImplemented)[source]#

Test deprecated_args with three drops and one rename.

tests.tools_deprecate_tests.deprecated_func_bad_args(self)[source]#

Deprecated.

Deprecated function with arg ‘self’.

tests.tools_deprecate_tests.deprecated_func_docstring(foo=None)[source]#

DEPRECATED. Deprecated function.

tests.tools_deprecate_tests.deprecated_func_docstring_arg(foo=None)[source]#

Deprecated.

Parameters:

foo – Foo. DEPRECATED.

tests.tools_deprecate_tests.deprecated_func_docstring_arg2(foo=None)[source]#

DEPRECATED.

Parameters:

foo – Foo. DEPRECATED.

tests.tools_deprecate_tests.deprecated_func_instead(foo=None)[source]#

Deprecated; use baz instead.

Deprecated function.

tests.tools_deprecate_tests.deprecated_func_instead_docstring(foo=None)[source]#

DEPRECATED, don’t use this. Deprecated function.