From c4fba3b7cab338d05bfc8a5336fe8aef4592c6fb Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Thu, 11 Aug 2016 01:02:37 -0700 Subject: [PATCH] Improved error messaging --- graphene/new_types/field.py | 4 ++-- graphene/new_types/tests/test_field.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/graphene/new_types/field.py b/graphene/new_types/field.py index f3d998e0..1d5a8259 100644 --- a/graphene/new_types/field.py +++ b/graphene/new_types/field.py @@ -61,8 +61,8 @@ class Field(OrderedType): self._type = type self.args = args or OrderedDict() # self.args = to_arguments(args, extra_args) - assert not (source and resolver), ('You cannot provide a source and a ' - 'resolver in a Field at the same time.') + assert not (source and resolver), ('A Field cannot have a source and a ' + 'resolver in at the same time.') if source: resolver = partial(source_resolver, source) self.resolver = resolver diff --git a/graphene/new_types/tests/test_field.py b/graphene/new_types/tests/test_field.py index 0863f6e4..6ecc9427 100644 --- a/graphene/new_types/tests/test_field.py +++ b/graphene/new_types/tests/test_field.py @@ -47,7 +47,7 @@ def test_field_not_source_and_resolver(): MyType = object() with pytest.raises(Exception) as exc_info: Field(MyType, source='value', resolver=lambda: None) - assert str(exc_info.value) == 'You cannot provide a source and a resolver in a Field at the same time.' + assert str(exc_info.value) == 'A Field cannot have a source and a resolver in at the same time.' def test_field_source_func(): MyType = object()