Skip to content

Commit 5e10d34

Browse files
committed
Change function name so that it's clearer what it does
1 parent 9d99f0e commit 5e10d34

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/pytest_bdd/scenario.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from .compat import getfixturedefs, inject_fixture
3030
from .feature import get_feature, get_features
3131
from .steps import StepFunctionContext, get_step_fixture_name
32-
from .utils import CONFIG_STACK, get_args, get_caller_module_locals, get_caller_module_path, identity
32+
from .utils import CONFIG_STACK, get_caller_module_locals, get_caller_module_path, get_required_args, identity
3333

3434
if TYPE_CHECKING:
3535
from _pytest.mark.structures import ParameterSet
@@ -227,7 +227,9 @@ def _execute_step_function(
227227
kwargs[STEP_ARGUMENT_DOCSTRING] = step.docstring
228228

229229
# Fill the missing arguments requesting the fixture values
230-
kwargs |= {arg: request.getfixturevalue(arg) for arg in get_args(context.step_func) if arg not in kwargs}
230+
kwargs |= {
231+
arg: request.getfixturevalue(arg) for arg in get_required_args(context.step_func) if arg not in kwargs
232+
}
231233

232234
kw["step_func_args"] = kwargs
233235

@@ -287,7 +289,7 @@ def decorator(*args: Callable[P, T]) -> Callable[P, T]:
287289
"scenario function can only be used as a decorator. Refer to the documentation."
288290
)
289291
[fn] = args
290-
func_args = get_args(fn)
292+
func_args = get_required_args(fn)
291293

292294
def scenario_wrapper(request: FixtureRequest, _pytest_bdd_example: dict[str, str]) -> Any:
293295
__tracebackhide__ = True

src/pytest_bdd/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@
2020
CONFIG_STACK: list[Config] = []
2121

2222

23-
def get_args(func: Callable[..., Any]) -> list[str]:
24-
"""Get a list of argument names for a function.
23+
def get_required_args(func: Callable[..., Any]) -> list[str]:
24+
"""Get a list of argument that are required for a function.
2525
2626
:param func: The function to inspect.
2727
2828
:return: A list of argument names.
29-
:rtype: list
3029
"""
3130
params = signature(func).parameters.values()
3231
return [

0 commit comments

Comments
 (0)