-
Notifications
You must be signed in to change notification settings - Fork 24
@pytest.inlineCallbacks but for async def's #31
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
Comments
I'm not sure what to call it or how @decorator.decorator
def asyncCallbacks(f, *args, **kwargs):
@pytest.inlineCallbacks
def wrapper(*args, **kwargs):
yield twisted.internet.defer.ensureDeferred(f())
return wrapper |
altendky
added a commit
to altendky/alqtendpy
that referenced
this issue
Sep 12, 2018
Drop the |
Then of course the option most like the existing @decorator.decorator
def asyncCallbacks(fun, *args, **kw):
return twisted.internet.defer.ensureDeferred(fun(*args, **kw)) (someday I'll make a PR with tests...) |
This was referenced Sep 19, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about a decorator to allow directly writing
async def
tests instead of having to wrap them with@pytest.inlineCallbacks
decorated tests.https://github.com/altendky/altendpyqt5/pull/10/files#diff-7531f542e8da5192e38a81a441db749e
Unless maybe I just haven't thought of an easy way to handle this with existing pieces.
The text was updated successfully, but these errors were encountered: