Giter Club home page Giter Club logo

Comments (3)

gilbsgilbs avatar gilbsgilbs commented on May 10, 2024 1

Unlike what I thought, it appears that the event loop isn't running inside finalizers. That means that my task would indeed never have been executed.

Consequently, this achieves what I was looking for:

@pytest.fixture
def foo_fixture(request, event_loop):
    def fin():
        async def afin():
            await some_stuff()
        event_loop.run_until_complete(afin())    
    request.addfinalizer(fin)
    return 42

I let you choose to close this issue or not. My point of view is that it would at least deserve a proper documentation. Better API would be nice to have, but since it's py35 only use-case, I don't really see the point, finally.

I can submit a documentation PR for this if you will. Let me know.

from pytest-asyncio.

dimaqq avatar dimaqq commented on May 10, 2024

My 2c: just document it.

IMO 3.6 asyncio is way better than 3.5 and we (as a community) should steer new developers to 3.6.

from pytest-asyncio.

gilbsgilbs avatar gilbsgilbs commented on May 10, 2024

@dimaqq Thanks! Can't agree more. The point is that LTS versions of some well-known Linux distros won't get support for py36 unless using third-party packages. So I'll just stick to 3.5 until next LTS.

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.