-
Notifications
You must be signed in to change notification settings - Fork 639
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
Async test function attribute #2409
Conversation
This macro is actually not even testing specific. Maybe it should be called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Maybe it should be called
block_on
and re-exported fromfutures_util
/futures
also?
I tend to prefer to provide this attribute as part of futures-test until #2295 is done. (block_on is provided by futures-executor that depend on futures-util, so it is difficult to provide this as part of futures-util.)
Co-authored-by: Taiki Endo <te316e89@gmail.com>
futures/tests/test_macro.rs
Outdated
|
||
#[futures_test::test] | ||
#[should_panic] | ||
async fn it_is_being_run() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if there is a reliable way to test if the generate test actually gets run. If the macro regresses and omits the attrs
and #[test]
, this will silently fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from a few nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again.
Resolves #1890