Skip to content

misleading warning about _fillfuncargs when calling fillfixtures #7815

@cjw296

Description

@cjw296

This warning:

FILLFUNCARGS = PytestDeprecationWarning(
"The `_fillfuncargs` function is deprecated, use "
"function._request._fillfixtures() instead if you cannot avoid reaching into internals."
)

...is raised from:

def fillfixtures(function: "Function") -> None:
"""Fill missing funcargs for a test function."""
warnings.warn(FILLFUNCARGS, stacklevel=2)

...suggesting the former is wrong, and super confusing when you're trying to track down where a warning is coming from in a plugin.

Related: what is the public and approved way for pytest plugins to explicitly request fixtures now?

I do this dance currently, but I've always wished for something more pleasant:

https://github.com/cjw296/sybil/blob/734a5769af840e6bf03f84e4eea9f9ed2681c4bb/sybil/integration/pytest.py#L41-L75

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions