diff --git a/examples/starwars/tests/test_query.py b/examples/starwars/tests/test_query.py index 88934b0e..b26374b6 100644 --- a/examples/starwars/tests/test_query.py +++ b/examples/starwars/tests/test_query.py @@ -72,7 +72,7 @@ def test_fetch_some_id_query(snapshot): } """ params = {"someId": "1000"} - snapshot.assert_match(client.execute(query, variables=params)) + snapshot.assert_match(client.execute(query, variable_values=params)) def test_fetch_some_id_query2(snapshot): @@ -84,7 +84,7 @@ def test_fetch_some_id_query2(snapshot): } """ params = {"someId": "1002"} - snapshot.assert_match(client.execute(query, variables=params)) + snapshot.assert_match(client.execute(query, variable_values=params)) def test_invalid_id_query(snapshot): @@ -96,7 +96,7 @@ def test_invalid_id_query(snapshot): } """ params = {"id": "not a valid id"} - snapshot.assert_match(client.execute(query, variables=params)) + snapshot.assert_match(client.execute(query, variable_values=params)) def test_fetch_luke_aliased(snapshot): diff --git a/graphene/types/tests/test_abstracttype.py b/graphene/types/tests/test_abstracttype.py index 41470383..a9798fd5 100644 --- a/graphene/types/tests/test_abstracttype.py +++ b/graphene/types/tests/test_abstracttype.py @@ -24,7 +24,7 @@ def test_abstract_objecttype_warn_deprecation(mocker): def test_generate_objecttype_inherit_abstracttype(): - class MyAbstractType(AbstractType): + class MyAbstractType: field1 = MyScalar() class MyObjectType(ObjectType, MyAbstractType): diff --git a/graphene/types/tests/test_datetime.py b/graphene/types/tests/test_datetime.py index dcbfb964..e846d4b5 100644 --- a/graphene/types/tests/test_datetime.py +++ b/graphene/types/tests/test_datetime.py @@ -110,7 +110,7 @@ def test_datetime_query_variable(sample_datetime): # test datetime variable provided as Python datetime result = schema.execute( """query Test($date: DateTime){ datetime(in: $date) }""", - variables={"date": sample_datetime}, + variable_values={"date": sample_datetime}, ) assert not result.errors assert result.data == {"datetime": isoformat} @@ -118,7 +118,7 @@ def test_datetime_query_variable(sample_datetime): # test datetime variable in string representation result = schema.execute( """query Test($date: DateTime){ datetime(in: $date) }""", - variables={"date": isoformat}, + variable_values={"date": isoformat}, ) assert not result.errors assert result.data == {"datetime": isoformat} @@ -130,14 +130,15 @@ def test_date_query_variable(sample_date): # test date variable provided as Python date result = schema.execute( """query Test($date: Date){ date(in: $date) }""", - variables={"date": sample_date}, + variable_values={"date": sample_date}, ) assert not result.errors assert result.data == {"date": isoformat} # test date variable in string representation result = schema.execute( - """query Test($date: Date){ date(in: $date) }""", variables={"date": isoformat} + """query Test($date: Date){ date(in: $date) }""", + variable_values={"date": isoformat}, ) assert not result.errors assert result.data == {"date": isoformat} @@ -149,14 +150,15 @@ def test_time_query_variable(sample_time): # test time variable provided as Python time result = schema.execute( """query Test($time: Time){ time(at: $time) }""", - variables={"time": sample_time}, + variable_values={"time": sample_time}, ) assert not result.errors assert result.data == {"time": isoformat} # test time variable in string representation result = schema.execute( - """query Test($time: Time){ time(at: $time) }""", variables={"time": isoformat} + """query Test($time: Time){ time(at: $time) }""", + variable_values={"time": isoformat}, ) assert not result.errors assert result.data == {"time": isoformat} @@ -171,7 +173,7 @@ def test_bad_variables(sample_date, sample_datetime, sample_time): """query Test($input: {}){{ {}(in: $input) }}""".format( type_, type_.lower() ), - variables={"input": input_}, + variable_values={"input": input_}, ) assert len(result.errors) == 1 # when `input` is not JSON serializable formatting the error message in diff --git a/graphene/types/tests/test_decimal.py b/graphene/types/tests/test_decimal.py index fd77f482..abc4a6c4 100644 --- a/graphene/types/tests/test_decimal.py +++ b/graphene/types/tests/test_decimal.py @@ -28,7 +28,7 @@ def test_decimal_string_query_variable(): result = schema.execute( """query Test($decimal: Decimal){ decimal(input: $decimal) }""", - variables={"decimal": decimal_value}, + variable_values={"decimal": decimal_value}, ) assert not result.errors assert result.data == {"decimal": str(decimal_value)} diff --git a/graphene/types/tests/test_generic.py b/graphene/types/tests/test_generic.py index 338da982..83e9bc88 100644 --- a/graphene/types/tests/test_generic.py +++ b/graphene/types/tests/test_generic.py @@ -39,7 +39,7 @@ def test_generic_query_variable(): ]: result = schema.execute( """query Test($generic: GenericScalar){ generic(input: $generic) }""", - variables={"generic": generic_value}, + variable_values={"generic": generic_value}, ) assert not result.errors assert result.data == {"generic": generic_value} diff --git a/graphene/types/tests/test_json.py b/graphene/types/tests/test_json.py index b5537180..1474038e 100644 --- a/graphene/types/tests/test_json.py +++ b/graphene/types/tests/test_json.py @@ -27,7 +27,7 @@ def test_jsonstring_query_variable(): result = schema.execute( """query Test($json: JSONString){ json(input: $json) }""", - variables={"json": json_value}, + variable_values={"json": json_value}, ) assert not result.errors assert result.data == {"json": json_value} diff --git a/graphene/types/tests/test_query.py b/graphene/types/tests/test_query.py index 69b0fa8f..76bf32a0 100644 --- a/graphene/types/tests/test_query.py +++ b/graphene/types/tests/test_query.py @@ -464,7 +464,7 @@ def test_query_annotated_resolvers(): assert not result.errors assert result.data == {"annotated": "base-self"} - result = test_schema.execute("{ context }", "base", context=context) + result = test_schema.execute("{ context }", "base", context_value=context) assert not result.errors assert result.data == {"context": "base-context"} diff --git a/graphene/types/tests/test_uuid.py b/graphene/types/tests/test_uuid.py index 2280b41f..9b3f93a0 100644 --- a/graphene/types/tests/test_uuid.py +++ b/graphene/types/tests/test_uuid.py @@ -25,7 +25,7 @@ def test_uuidstring_query_variable(): result = schema.execute( """query Test($uuid: UUID){ uuid(input: $uuid) }""", - variables={"uuid": uuid_value}, + variable_values={"uuid": uuid_value}, ) assert not result.errors assert result.data == {"uuid": uuid_value}