Use asyncio.set_event_loop_policy instead of event_loop_policy

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      error seen in "install from SDist and Test" github action – for example here: https://github.com/mongodb/mongo-python-driver/actions/runs/26484047833/job/77987534427?pr=2813

      error states that: Overriding the "event_loop_policy" fixture is deprecated and will be removed in a future version of pytest-asyncio. Use the "pytest_asyncio_loop_factories" hook to customize event loop creation.

       

      edit: I think pytest_asyncio_loop_factories is per test and that'd be really annoying to modify every test to use a different loop if its windows but i think asyncio.set_event_loop_policy can change it globally for windows similar to what we did with pytest's event_loop_policy? 

      Definition of done

      What must be done to consider the task complete?

      replace depricated event_loop_policy

      Pitfalls

      What should the implementer watch out for? What are the risks?

            Assignee:
            Iris Ho
            Reporter:
            Iris Ho
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: