11from typing import cast
22
3- from pytest import fixture , mark , raises
3+ from pytest import mark , raises
44
55from graphql .language import parse
66from graphql .type import (
@@ -784,8 +784,7 @@ def schema_with_enum(name):
784784
785785
786786def describe_type_system_object_fields_must_have_output_types ():
787- @fixture
788- def schema_with_object_field_of_type (field_type ):
787+ def _schema_with_object_field_of_type (field_type ):
789788 BadObjectType = GraphQLObjectType (
790789 "BadObject" , {"badField" : GraphQLField (field_type )}
791790 )
@@ -796,29 +795,29 @@ def schema_with_object_field_of_type(field_type):
796795
797796 @mark .parametrize ("type_" , output_types )
798797 def accepts_an_output_type_as_an_object_field_type (type_ ):
799- schema = schema_with_object_field_of_type (type_ )
798+ schema = _schema_with_object_field_of_type (type_ )
800799 assert validate_schema (schema ) == []
801800
802801 def rejects_an_empty_object_field_type ():
803802 # invalid schema cannot be built with Python
804803 with raises (TypeError ) as exc_info :
805- schema_with_object_field_of_type (None )
804+ _schema_with_object_field_of_type (None )
806805 msg = str (exc_info .value )
807806 assert msg == "Field type must be an output type."
808807
809808 @mark .parametrize ("type_" , not_output_types )
810809 def rejects_a_non_output_type_as_an_object_field_type (type_ ):
811810 # invalid schema cannot be built with Python
812811 with raises (TypeError ) as exc_info :
813- schema_with_object_field_of_type (type_ )
812+ _schema_with_object_field_of_type (type_ )
814813 msg = str (exc_info .value )
815814 assert msg == "Field type must be an output type."
816815
817816 @mark .parametrize ("type_" , [int , float , str ])
818817 def rejects_a_non_type_value_as_an_object_field_type (type_ ):
819818 # invalid schema cannot be built with Python
820819 with raises (TypeError ) as exc_info :
821- schema_with_object_field_of_type (type_ )
820+ _schema_with_object_field_of_type (type_ )
822821 msg = str (exc_info .value )
823822 assert msg == "Field type must be an output type."
824823
@@ -1064,8 +1063,7 @@ def rejects_object_implementing_extended_interface_due_to_type_mismatch():
10641063
10651064
10661065def describe_type_system_interface_fields_must_have_output_types ():
1067- @fixture
1068- def schema_with_interface_field_of_type (field_type ):
1066+ def _schema_with_interface_field_of_type (field_type ):
10691067 BadInterfaceType = GraphQLInterfaceType (
10701068 "BadInterface" , {"badField" : GraphQLField (field_type )}
10711069 )
@@ -1081,29 +1079,29 @@ def schema_with_interface_field_of_type(field_type):
10811079
10821080 @mark .parametrize ("type_" , output_types )
10831081 def accepts_an_output_type_as_an_interface_field_type (type_ ):
1084- schema = schema_with_interface_field_of_type (type_ )
1082+ schema = _schema_with_interface_field_of_type (type_ )
10851083 assert validate_schema (schema ) == []
10861084
10871085 def rejects_an_empty_interface_field_type ():
10881086 # invalid schema cannot be built with Python
10891087 with raises (TypeError ) as exc_info :
1090- schema_with_interface_field_of_type (None )
1088+ _schema_with_interface_field_of_type (None )
10911089 msg = str (exc_info .value )
10921090 assert msg == "Field type must be an output type."
10931091
10941092 @mark .parametrize ("type_" , not_output_types )
10951093 def rejects_a_non_output_type_as_an_interface_field_type (type_ ):
10961094 # invalid schema cannot be built with Python
10971095 with raises (TypeError ) as exc_info :
1098- schema_with_interface_field_of_type (type_ )
1096+ _schema_with_interface_field_of_type (type_ )
10991097 msg = str (exc_info .value )
11001098 assert msg == "Field type must be an output type."
11011099
11021100 @mark .parametrize ("type_" , [int , float , str ])
11031101 def rejects_a_non_type_value_as_an_interface_field_type (type_ ):
11041102 # invalid schema cannot be built with Python
11051103 with raises (TypeError ) as exc_info :
1106- schema_with_interface_field_of_type (type_ )
1104+ _schema_with_interface_field_of_type (type_ )
11071105 msg = str (exc_info .value )
11081106 assert msg == "Field type must be an output type."
11091107
@@ -1151,8 +1149,7 @@ def accepts_an_interface_not_implemented_by_at_least_one_object():
11511149
11521150
11531151def describe_type_system_field_arguments_must_have_input_types ():
1154- @fixture
1155- def schema_with_arg_of_type (arg_type ):
1152+ def _schema_with_arg_of_type (arg_type ):
11561153 BadObjectType = GraphQLObjectType (
11571154 "BadObject" ,
11581155 {
@@ -1167,29 +1164,29 @@ def schema_with_arg_of_type(arg_type):
11671164
11681165 @mark .parametrize ("type_" , input_types )
11691166 def accepts_an_input_type_as_a_field_arg_type (type_ ):
1170- schema = schema_with_arg_of_type (type_ )
1167+ schema = _schema_with_arg_of_type (type_ )
11711168 assert validate_schema (schema ) == []
11721169
11731170 def rejects_an_empty_field_arg_type ():
11741171 # invalid schema cannot be built with Python
11751172 with raises (TypeError ) as exc_info :
1176- schema_with_arg_of_type (None )
1173+ _schema_with_arg_of_type (None )
11771174 msg = str (exc_info .value )
11781175 assert msg == "Argument type must be a GraphQL input type."
11791176
11801177 @mark .parametrize ("type_" , not_input_types )
11811178 def rejects_a_non_input_type_as_a_field_arg_type (type_ ):
11821179 # invalid schema cannot be built with Python
11831180 with raises (TypeError ) as exc_info :
1184- schema_with_arg_of_type (type_ )
1181+ _schema_with_arg_of_type (type_ )
11851182 msg = str (exc_info .value )
11861183 assert msg == "Argument type must be a GraphQL input type."
11871184
11881185 @mark .parametrize ("type_" , [int , float , str ])
11891186 def rejects_a_non_type_value_as_a_field_arg_type (type_ ):
11901187 # invalid schema cannot be built with Python
11911188 with raises (TypeError ) as exc_info :
1192- schema_with_arg_of_type (type_ )
1189+ _schema_with_arg_of_type (type_ )
11931190 msg = str (exc_info .value )
11941191 assert msg == "Argument type must be a GraphQL input type."
11951192
@@ -1215,8 +1212,7 @@ def rejects_a_non_input_type_as_a_field_arg_with_locations():
12151212
12161213
12171214def describe_type_system_input_object_fields_must_have_input_types ():
1218- @fixture
1219- def schema_with_input_field_of_type (input_field_type ):
1215+ def _schema_with_input_field_of_type (input_field_type ):
12201216 BadInputObjectType = GraphQLInputObjectType (
12211217 "BadInputObject" , {"badField" : GraphQLInputField (input_field_type )}
12221218 )
@@ -1234,29 +1230,29 @@ def schema_with_input_field_of_type(input_field_type):
12341230
12351231 @mark .parametrize ("type_" , input_types )
12361232 def accepts_an_input_type_as_an_input_fieldtype (type_ ):
1237- schema = schema_with_input_field_of_type (type_ )
1233+ schema = _schema_with_input_field_of_type (type_ )
12381234 assert validate_schema (schema ) == []
12391235
12401236 def rejects_an_empty_input_field_type ():
12411237 # invalid schema cannot be built with Python
12421238 with raises (TypeError ) as exc_info :
1243- schema_with_input_field_of_type (None )
1239+ _schema_with_input_field_of_type (None )
12441240 msg = str (exc_info .value )
12451241 assert msg == "Input field type must be a GraphQL input type."
12461242
12471243 @mark .parametrize ("type_" , not_input_types )
12481244 def rejects_a_non_input_type_as_an_input_field_type (type_ ):
12491245 # invalid schema cannot be built with Python
12501246 with raises (TypeError ) as exc_info :
1251- schema_with_input_field_of_type (type_ )
1247+ _schema_with_input_field_of_type (type_ )
12521248 msg = str (exc_info .value )
12531249 assert msg == "Input field type must be a GraphQL input type."
12541250
12551251 @mark .parametrize ("type_" , [int , float , str ])
12561252 def rejects_a_non_type_value_as_an_input_field_type (type_ ):
12571253 # invalid schema cannot be built with Python
12581254 with raises (TypeError ) as exc_info :
1259- schema_with_input_field_of_type (type_ )
1255+ _schema_with_input_field_of_type (type_ )
12601256 msg = str (exc_info .value )
12611257 assert msg == "Input field type must be a GraphQL input type."
12621258
0 commit comments