Let unittest frameworks deal with async functions#7144
Merged
nicoddemus merged 1 commit intopytest-dev:masterfrom May 1, 2020
Merged
Let unittest frameworks deal with async functions#7144nicoddemus merged 1 commit intopytest-dev:masterfrom
nicoddemus merged 1 commit intopytest-dev:masterfrom
Conversation
Member
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
I wonder if we perhaps should remove wrappers alltogether, are there exception handling hooks in the reporting for pdb to be hooked in
04ebaf2 to
bebbb2d
Compare
Member
Author
Definitely, but I prefer to do that in a separate PR (which I intend to tackle next). Btw noticed that this also fixes #6924 regarding clean up functions not being called, so I updated both tests to also ensure that. |
bebbb2d to
f543851
Compare
RonnyPfannschmidt
approved these changes
May 1, 2020
Member
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
lovely then, im curious about the followup as well
Instead of trying to handle unittest-async functions in pytest_pyfunc_call, let the unittest framework handle them instead. This lets us remove the hack in pytest_pyfunc_call, with the upside that we should support any unittest-async based framework. Also included 'asynctest' as test dependency for py37-twisted, and renamed 'twisted' to 'unittestextras' to better reflect that we install 'twisted' and 'asynctest' now. This also fixes the problem of cleanUp functions not being properly called for async functions. Fix pytest-dev#7110 Fix pytest-dev#6924
f543851 to
fd2f172
Compare
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this pull request
May 1, 2020
4 tasks
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.
Instead of trying to handle unittest-async functions in
pytest_pyfunc_call,let the
unittestframework handle them instead.This lets us remove the hack in
pytest_pyfunc_call, with the upside thatwe should support any unittest-async based framework.
Also included
asynctestas test dependency forpy37-twisted, and renamedtwistedtounittestextrasto better reflect that we installtwistedandasynctestnow instead of onlytwisted.This also fixes the problem of cleanUp functions not being properly called for async functions.
Fix #7110
Fix #6924