Create new event loop as fallback behaviour.#5753
Draft
paul-ollis wants to merge 1 commit intoTextualize:mainfrom
Draft
Create new event loop as fallback behaviour.#5753paul-ollis wants to merge 1 commit intoTextualize:mainfrom
paul-ollis wants to merge 1 commit intoTextualize:mainfrom
Conversation
The method App.push_screen tries to create a Future using `asyncio.get_running_loop()`. If this raises a RuntimeError it simply invokes `Future()`, as a fallback, order to support some of the tests. When running tests using pytest-xdist it is possible for this fallback mechanism to fail and instead raise another RuntimeError when `Future()` tries to get the 'standard' event loop. This is a rare occurrence with the current tests' structure, but I have seen it a number of times. It is causes by a test that invokes App.run (which invokes asyncio.run) being executed before a test that depends on the aforementioned fallback mechanism. Both tests must be executed by the same pytest-xdist worker process.
Contributor
|
This is resolved by #5765 |
Contributor
Author
|
I have converted this to a draft on the assumption that by #5765 will get merged in due course. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The method App.push_screen tries to create a Future using
asyncio.get_running_loop(). If this raises a RuntimeError it simply invokesFuture(), as a fallback, order to support some of the tests.When running tests using pytest-xdist it is possible for this fallback mechanism to fail and instead raise another RuntimeError when
Future()tries to get the 'standard' event loop. This is a rare occurrence with the current tests' structure, but I have seen it a number of times.It is causes by a test that invokes App.run (which invokes asyncio.run) being executed before a test that depends on the aforementioned fallback mechanism. Both tests must be executed by the same pytest-xdist worker process.
Please review the following checklist.