Skip to content

Commit fd22340

Browse files
authored
Merge pull request #252 from pytest-dev/rename-param
Rename `fixtures` params to `dependencies`
2 parents 059bb0c + 95ef46b commit fd22340

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/pytest_factoryboy/fixture.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def generate_fixtures(
187187
create_fixture_with_related(
188188
name=model_name,
189189
function=functools.partial(model_fixture, factory_name=factory_name),
190-
fixtures=deps,
190+
dependencies=deps,
191191
related=related,
192192
),
193193
)
@@ -196,12 +196,12 @@ def generate_fixtures(
196196
def create_fixture_with_related(
197197
name: str,
198198
function: Callable[P, T],
199-
fixtures: Collection[str] | None = None,
199+
dependencies: Collection[str] | None = None,
200200
related: Collection[str] | None = None,
201201
) -> Callable[P, T]:
202202
if related is None:
203203
related = []
204-
fixture, fn = create_fixture(name=name, function=function, fixtures=fixtures)
204+
fixture, fn = create_fixture(name=name, function=function, dependencies=dependencies)
205205

206206
# We have to set the `_factoryboy_related` attribute to the original function, since
207207
# FixtureDef.func will provide that one later when we discover the related fixtures.
@@ -234,7 +234,7 @@ def make_declaration_fixturedef(
234234
return create_fixture_with_related(
235235
name=attr_name,
236236
function=functools.partial(subfactory_fixture, factory_class=subfactory_class),
237-
fixtures=args,
237+
dependencies=args,
238238
)
239239

240240
deps: list[str] # makes mypy happy
@@ -254,7 +254,7 @@ def make_declaration_fixturedef(
254254
return create_fixture_with_related(
255255
name=attr_name,
256256
function=functools.partial(attr_fixture, value=value),
257-
fixtures=deps,
257+
dependencies=deps,
258258
)
259259

260260

src/pytest_factoryboy/fixturegen.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
def create_fixture(
1818
name: str,
1919
function: Callable[P, T],
20-
fixtures: Collection[str] | None = None,
20+
dependencies: Collection[str] | None = None,
2121
) -> tuple[PytestFixtureT, Callable[P, T]]:
2222
"""Dynamically create a pytest fixture.
2323
2424
:param name: Name of the fixture.
2525
:param function: Function to be called.
26-
:param fixtures: List of fixtures dependencies, but that will not be passed to ``function``.
26+
:param dependencies: List of fixtures dependencies, but that will not be passed to ``function``.
2727
:return: The created fixture function and the actual function.
2828
2929
Example:
@@ -40,10 +40,10 @@ def create_fixture(
4040
def book(name, db):
4141
return Book(name=name)
4242
"""
43-
if fixtures is None:
44-
fixtures = []
43+
if dependencies is None:
44+
dependencies = []
4545

46-
@usefixtures(*fixtures)
46+
@usefixtures(*dependencies)
4747
@functools.wraps(function)
4848
def fn(*args: P.args, **kwargs: P.kwargs) -> T:
4949
return function(*args, **kwargs)

0 commit comments

Comments
 (0)