Skip to content

Commit dc0f49e

Browse files
committed
Allow disabling factory deps
1 parent fca00b6 commit dc0f49e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pytest_factoryboy/fixture.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from funcsigs import signature
1818

1919
SEPARATOR = "__"
20+
IS_SUBFACTORY_DEPS_ENABLED = True
2021

2122

2223
FIXTURE_FUNC_FORMAT = """
@@ -87,7 +88,8 @@ def register(factory_class, _name=None, **kwargs):
8788
else:
8889
value = kwargs.get(attr, value)
8990

90-
if isinstance(value, (factory.SubFactory, factory.RelatedFactory)):
91+
if (IS_SUBFACTORY_DEPS_ENABLED
92+
and isinstance(value, (factory.SubFactory, factory.RelatedFactory))):
9193
subfactory_class = value.get_factory()
9294
subfactory_deps = get_deps(subfactory_class, factory_class)
9395

0 commit comments

Comments
 (0)