Coder Social home page Coder Social logo

Comments (2)

seifertm avatar seifertm commented on May 27, 2024

Thanks for the investigation. This seems to be connected to #713 .

The pytest-asyncio currently creates "dynamic" fixtures by adding them to the Python object, for example a module. Once the module is collected by pytest, the fixture is evaluated as usual. This approach is internally used by pytest as well and leaves the complicated fixture evaluation to pytest rather than having to reproduce in pytest-asyncio.

Unfortunately, pytest-asyncio currently adds those fixtures as part of the pytest_collectstart hook. When trying to add a fixture to a module, that module is imported and may raise errors like pytest._outcomes.Skip or pytest.CollectError. The pytest_collectstart hook isn't supposed to handle those kinds of exceptions, so pytest-asyncio tries to do it. That effort seems to be unsuccessful so far.

Given that fixing one bug leads to another bug, I think pytest-asyncio should look for an entirely different place to add the fixtures rather than in pytest_collectstart. There are chances that, in the future, pytest will provide a way to add fixtures to nodes, but until then pytest-asyncio needs to find a better workaround.

from pytest-asyncio.

seifertm avatar seifertm commented on May 27, 2024

@collielimabean This should be resolve with pytest-asyncio v0.23.3

from pytest-asyncio.

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.