Skip to content

Commit

Permalink
Allow disabling factory deps
Browse files Browse the repository at this point in the history
  • Loading branch information
charlax committed May 17, 2019
1 parent fca00b6 commit dc0f49e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytest_factoryboy/fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from funcsigs import signature

SEPARATOR = "__"
IS_SUBFACTORY_DEPS_ENABLED = True


FIXTURE_FUNC_FORMAT = """
Expand Down Expand Up @@ -87,7 +88,8 @@ def register(factory_class, _name=None, **kwargs):
else:
value = kwargs.get(attr, value)

if isinstance(value, (factory.SubFactory, factory.RelatedFactory)):
if (IS_SUBFACTORY_DEPS_ENABLED
and isinstance(value, (factory.SubFactory, factory.RelatedFactory))):
subfactory_class = value.get_factory()
subfactory_deps = get_deps(subfactory_class, factory_class)

Expand Down

0 comments on commit dc0f49e

Please sign in to comment.