diff --git a/graphene/types/tests/test_abstracttype.py b/graphene/types/tests/test_abstracttype.py index b1bcaa3f..6484deb8 100644 --- a/graphene/types/tests/test_abstracttype.py +++ b/graphene/types/tests/test_abstracttype.py @@ -23,7 +23,7 @@ def test_abstract_objecttype_warn_deprecation(mocker): class MyAbstractType(AbstractType): field1 = MyScalar() - abstracttype.warn_deprecation.assert_called_once() + assert abstracttype.warn_deprecation.called def test_generate_objecttype_inherit_abstracttype(): diff --git a/graphene/types/tests/test_query.py b/graphene/types/tests/test_query.py index ebc78c1d..4adcedf9 100644 --- a/graphene/types/tests/test_query.py +++ b/graphene/types/tests/test_query.py @@ -420,16 +420,16 @@ def test_query_annotated_resolvers(): context = String() info = String() - @annotate + @annotate(_trigger_warning=False) def resolve_annotated(self, id): return "{}-{}".format(self, id) - @annotate(context=Context) + @annotate(context=Context, _trigger_warning=False) def resolve_context(self, context): assert isinstance(context, Context) return "{}-{}".format(self, context.key) - @annotate(info=ResolveInfo) + @annotate(info=ResolveInfo, _trigger_warning=False) def resolve_info(self, info): assert isinstance(info, ResolveInfo) return "{}-{}".format(self, info.field_name) diff --git a/graphene/utils/resolve_only_args.py b/graphene/utils/resolve_only_args.py index e30f1f03..0856ffcc 100644 --- a/graphene/utils/resolve_only_args.py +++ b/graphene/utils/resolve_only_args.py @@ -4,12 +4,10 @@ from .deprecated import deprecated if PY2: deprecation_reason = ( - 'The decorator @resolve_only_args is deprecated.\n' 'Please use @annotate instead.' ) else: deprecation_reason = ( - 'The decorator @resolve_only_args is deprecated.\n' 'Please use Python 3 type annotations instead. Read more: ' 'https://docs.python.org/3/library/typing.html' ) diff --git a/graphene/utils/tests/test_annotate.py b/graphene/utils/tests/test_annotate.py index f213919a..760a8bf5 100644 --- a/graphene/utils/tests/test_annotate.py +++ b/graphene/utils/tests/test_annotate.py @@ -17,17 +17,17 @@ func_with_annotations.__annotations__ = annotations def test_annotate_with_no_params(): - annotated_func = annotate(func) + annotated_func = annotate(func, _trigger_warning=False) assert annotated_func.__annotations__ == {} def test_annotate_with_params(): - annotated_func = annotate(**annotations)(func) + annotated_func = annotate(_trigger_warning=False, **annotations)(func) assert annotated_func.__annotations__ == annotations def test_annotate_with_wront_params(): with pytest.raises(Exception) as exc_info: - annotated_func = annotate(p=int)(func) + annotated_func = annotate(p=int, _trigger_warning=False)(func) assert str(exc_info.value) == 'The key p is not a function parameter in the function "func".' diff --git a/graphene/utils/tests/test_resolve_only_args.py b/graphene/utils/tests/test_resolve_only_args.py index d0d06e51..a3090c3a 100644 --- a/graphene/utils/tests/test_resolve_only_args.py +++ b/graphene/utils/tests/test_resolve_only_args.py @@ -10,4 +10,4 @@ def test_resolve_only_args(mocker): my_data = {'one': 1, 'two': 2} wrapped = resolve_only_args(resolver) - deprecated.warn_deprecation.assert_called_once() + assert deprecated.warn_deprecation.called