Skip to content

Conversation

@willemt
Copy link
Owner

@willemt willemt commented Apr 28, 2025

No description provided.

@willemt willemt requested a review from Copilot April 28, 2025 22:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the test running logic by moving run_tests to the module scope and reorganizing helper functions. Key changes include:

  • Extracting helper functions (get_coro, wrap_in_sync, cancel_task) to module scope.
  • Updating the _run_test_loop to return flaky tests for potential retries.
  • Modifying the pytest_runtestloop hook to use the new test loop implementation.
Comments suppressed due to low confidence (2)

pytest_asyncio_cooperative/plugin.py:125

  • [nitpick] The function name 'get_coro' is very generic. Consider renaming it to something like 'extract_coro' to better indicate that it extracts the coroutine from a task.
def get_coro(task):

pytest_asyncio_cooperative/plugin.py:262

  • Since the _run_test_loop now returns flaky tests for retries and uses a new event loop, please ensure there are adequate integration tests covering both the main test run and flaky test retry behavior.
def _run_test_loop(tasks, session, item_by_coro):

@willemt willemt force-pushed the refac-run_tests branch 3 times, most recently from 9856b83 to 69cbc34 Compare April 28, 2025 23:01
@willemt willemt merged commit 2c48dae into master Apr 28, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants