Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4843

Async test suite should use a single event loop

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed

      After PYTHON-4725, an AsyncMongoClient can only be used on a single event loop because the SDAM and other various background tasks are bound to the loop used to open the client.

      For this reason, the async test suite should use a single event loop for all tests:
      https://pytest-asyncio.readthedocs.io/en/latest/how-to-guides/run_package_tests_in_same_loop.html

      import pytest
      pytestmark = pytest.mark.asyncio(loop_scope="package")
      

      Any tests for using multiple/different loops (eg PYTHON-4724) should be handwritten.

            Assignee:
            noah.stapp@mongodb.com Noah Stapp
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: