diff --git a/src/graphql/validation/rules/overlapping_fields_can_be_merged.py b/src/graphql/validation/rules/overlapping_fields_can_be_merged.py index 92279254..67714c40 100644 --- a/src/graphql/validation/rules/overlapping_fields_can_be_merged.py +++ b/src/graphql/validation/rules/overlapping_fields_can_be_merged.py @@ -603,10 +603,10 @@ def same_arguments( args1 = node1.arguments args2 = node2.arguments - if args1 is None or len(args1) == 0: - return args2 is None or len(args2) == 0 + if not args1: + return not args2 - if args2 is None or len(args2) == 0: + if not args2: return False if len(args1) != len(args2): diff --git a/tests/benchmarks/test_repeated_fields_benchmark.py b/tests/benchmarks/test_repeated_fields.py similarity index 72% rename from tests/benchmarks/test_repeated_fields_benchmark.py rename to tests/benchmarks/test_repeated_fields.py index 0d3b5e4c..daba6169 100644 --- a/tests/benchmarks/test_repeated_fields_benchmark.py +++ b/tests/benchmarks/test_repeated_fields.py @@ -6,22 +6,20 @@ graphql_sync, ) - schema = GraphQLSchema( query=GraphQLObjectType( name="Query", fields={ "hello": GraphQLField( GraphQLString, - resolve=lambda obj, info: "world", + resolve=lambda _obj, _info: "world", ) }, ) ) -source = "query {{ {fields} }}".format(fields="hello " * 250) +source = f"{{ {'hello ' * 250}}}" def test_many_repeated_fields(benchmark): - print(source) result = benchmark(lambda: graphql_sync(schema, source)) - assert not result.errors + assert result == ({"hello": "world"}, None) diff --git a/tests/execution/test_stream.py b/tests/execution/test_stream.py index e2fdb80b..9ab60f9f 100644 --- a/tests/execution/test_stream.py +++ b/tests/execution/test_stream.py @@ -1297,6 +1297,7 @@ async def friend_list(_info): ] @pytest.mark.asyncio() + @pytest.mark.filterwarnings("ignore:.* was never awaited:RuntimeWarning") async def filters_stream_payloads_that_are_nulled_in_a_deferred_payload(): document = parse( """