@@ -144,7 +144,9 @@ def get_model_name(factory_class):
144144 """Get model fixture name by factory."""
145145 return (
146146 inflection .underscore (factory_class ._meta .model .__name__ )
147- if not isinstance (factory_class ._meta .model , str ) else factory_class ._meta .model )
147+ if not isinstance (factory_class ._meta .model , str )
148+ else factory_class ._meta .model
149+ )
148150
149151
150152def get_factory_name (factory_class ):
@@ -164,17 +166,15 @@ def is_dep(value):
164166 if isinstance (value , factory .RelatedFactory ):
165167 return False
166168 if isinstance (value , factory .SubFactory ) and get_model_name (value .get_factory ()) == parent_model_name :
167- return False
169+ return False
168170 if isinstance (value , factory .declarations .PostGeneration ):
169171 # Dependency on extracted value
170172 return True
171173
172174 return True
173175
174176 return [
175- SEPARATOR .join ((model_name , attr ))
176- for attr , value in factory_class ._meta .declarations .items ()
177- if is_dep (value )
177+ SEPARATOR .join ((model_name , attr )) for attr , value in factory_class ._meta .declarations .items () if is_dep (value )
178178 ]
179179
180180
@@ -199,7 +199,8 @@ class Factory(factory_class):
199199 pass
200200
201201 Factory ._meta .base_declarations = dict (
202- (k , v ) for k , v in Factory ._meta .base_declarations .items ()
202+ (k , v )
203+ for k , v in Factory ._meta .base_declarations .items ()
203204 if not isinstance (v , factory .declarations .PostGenerationDeclaration )
204205 )
205206 Factory ._meta .post_declarations = factory .builder .DeclarationSet ()
@@ -233,7 +234,7 @@ class Factory(factory_class):
233234 argname = "" .join ((prefix , attr ))
234235 extra = {}
235236 for k , v in factory_class ._meta .post_declarations .contexts [attr ].items ():
236- if k == '' :
237+ if k == "" :
237238 continue
238239 post_attr = SEPARATOR .join ((argname , k ))
239240
@@ -339,10 +340,7 @@ def __init__(self, fixture):
339340 self .fixture = fixture
340341 if callable (self .fixture ):
341342 params = signature (self .fixture ).parameters .values ()
342- self .args = [
343- param .name for param in params
344- if param .kind == param .POSITIONAL_OR_KEYWORD
345- ]
343+ self .args = [param .name for param in params if param .kind == param .POSITIONAL_OR_KEYWORD ]
346344 else :
347345 self .args = [self .fixture ]
348346
0 commit comments