Closed DevKeravi closed 6 months ago
I found this commit for pytest 8.1 version
that is only option for this problem?
The signature of this (private) function will change in the upcoming
pytest 8.1 release:
https://github.com/pytest-dev/pytest/pull/11785
Additionally, the `iterparentnodeids` function is removed, so
copy/pasting it for now.
I verified that all tests pass when run against pytest main.
I fork master branch and that commit working that issue, but I found more issue that pytest's FixtureDef Class initializer doesn't take fixturemanager no longer,
this is removed commit 2 month ago
fixtures: avoid FixtureDef <-> FixtureManager reference cycle
There is no need to store the FixtureManager on each FixtureDef.
and I found this in code.
this is in _pytest/fixture.py 960 line, FixtureDef init code
def __init__(
self,
config: Config,
baseid: Optional[str],
argname: str,
func: "_FixtureFunc[FixtureValue]",
scope: Union[Scope, _ScopeName, Callable[[str, Config], _ScopeName], None],
params: Optional[Sequence[object]],
unittest: bool = False,
ids: Optional[
Union[Tuple[Optional[object], ...], Callable[[Any], Optional[object]]]
] = None,
*,
_ispytest: bool = False,
) -> None:
this is pytest-bdd/steps.py line 212 FixtureDef initialize code
def inject_fixture(request: FixtureRequest, arg: str, value: Any) -> None:
"""Inject fixture into pytest fixture request.
:param request: pytest fixture request
:param arg: argument name
:param value: argument value
"""
fd = FixtureDef(
fixturemanager=request._fixturemanager,
baseid=None,
argname=arg,
func=lambda: value,
scope="function",
params=None,
)
As you say, this is already fixed, only a release is missing (which should happen today: https://github.com/pytest-dev/pytest-bdd/pull/666#issuecomment-1975908677)
pytest-bdd 7.1.1 is out
@youtux I read your comment and I upgrade pytest-bdd version but pytest yanked there version 8.1.0 to 8.0.3 cause so many plugin crashed thanks for answer and have a nice day :)
pytest-dev/pytest#12069
Today pytest has been updated version 8.1.0 they update this thing
I update my pytest version to 8.1.0, pytest-bdd couldn't find this removed method so I getting this errors,
now iterparentnodeids function has been removed, but it can traverse the node hierarchy itself so why don't we change that code?
this is my full error logs