Code Monkey home page Code Monkey logo

Comments (5)

The-Compiler avatar The-Compiler commented on July 3, 2024 1

As you say, this is already fixed, only a release is missing (which should happen today: #666 (comment))

from pytest-bdd.

DevKeravi avatar DevKeravi commented on July 3, 2024

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.

from pytest-bdd.

DevKeravi avatar DevKeravi commented on July 3, 2024

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,
    )

from pytest-bdd.

youtux avatar youtux commented on July 3, 2024

pytest-bdd 7.1.1 is out

from pytest-bdd.

DevKeravi avatar DevKeravi commented on July 3, 2024

@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 :)

from pytest-bdd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.