-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clock event loop as default #110
Closed
derekbrokeit
wants to merge
18
commits into
pytest-dev:master
from
derekbrokeit:add-clock-event-loop-as-default
Closed
Add clock event loop as default #110
derekbrokeit
wants to merge
18
commits into
pytest-dev:master
from
derekbrokeit:add-clock-event-loop-as-default
Conversation
This file contains 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
…ndard loop improve documentation of ClockEventLoop
…nt-loop * remotes/base/master: More specific Hypothesis detection Support async tests which use Hypothesis Move pytest warning config to setup.cfg Fix: Avoid warning on latest Pytest versions
…t run unless needed
- ClockEventLoop is developed in a function to allow for later changes to event loop policies - rework `advance_time` method to better symbolize the needed loop iterations. This is marked by a change to a function that returns an awaitable.
- uses a custom policy meta class that uses the existing policy to modify the new loop it creates. - The new loop it creates is modified to provide `advance_time` coroutine for testing - Extends pytest-dev#96 to make ClockEventLoop the default policy for testing
Looking at this implementation, the same utilities here can actually be refactored out to a clean fixture as suggested in #83 if desired. If desired, the |
derekbrokeit
added a commit
to derekbrokeit/pytest-asyncio
that referenced
this pull request
Feb 18, 2019
Closing this because #113 is a better solution in my opinion |
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.
Extend #96 clock_event_loop fixture to become default event_loop
modify the new loop it creates.
advance_time
coroutine for testing
I am adding this as a separate merge request because I am uncertain if making this behavior default is desirable, so it is here for your consideration. As I mentioned in #96, if this behavior is to be as a separate event-loop, major refactoring to the
pytest_fixture_setup
and similar methods will be needed since they all assumeevent_loop
is the name of the fixture for event-loops. There is currently no trivial way to allow custom event-loops in pytest-asyncio as far as I can tell. This is the reason #96 fails many of the tests.