Skip to content
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

Define #[future] attribute to remove Future boilerplate #98

Closed
la10736 opened this issue Jun 28, 2020 · 7 comments
Closed

Define #[future] attribute to remove Future boilerplate #98

la10736 opened this issue Jun 28, 2020 · 7 comments

Comments

@la10736
Copy link
Owner

la10736 commented Jun 28, 2020

Every time an argument (test or fixture) is marked by #[future] attribute wrap type T by impl std::future::Future<Output = T>

@raffomania
Copy link

Hey, do you have an idea on how this might be possible?
We just tried to solve this with our own type alias, but you can't use those together with impl yet.

@svenstaro svenstaro mentioned this issue Apr 21, 2021
4 tasks
@la10736
Copy link
Owner Author

la10736 commented Apr 22, 2021

I'm working on #111 now. Unfortunately in the last week ends I was very busy ... I'll implement this feature as the next one.

@svenstaro
Copy link
Contributor

Alright that sounds great! Thanks. rstest continues to be awesome, I use it in pretty much all of my projects.

@la10736
Copy link
Owner Author

la10736 commented May 1, 2021

Ok, I cannot use #[asyc] because async is a keyword. Use #[future] instead

la10736 added a commit that referenced this issue May 1, 2021
@la10736
Copy link
Owner Author

la10736 commented May 1, 2021

Basic implementation is in place.

What's missed:

  • Integrations test for rstest
    • Cases
    • Values
    • Single
  • Unit tests
  • Discard invalid cases like impl or some other strange types
  • Implement explicit lifetime substitution for references
  • Little refactoring
  • Documentation
  • Changelog

la10736 added a commit that referenced this issue May 1, 2021
la10736 added a commit that referenced this issue May 1, 2021
la10736 added a commit that referenced this issue May 2, 2021
la10736 added a commit that referenced this issue May 2, 2021
@la10736 la10736 changed the title Define #[async] attribute to remove Future boilerplate Define #[future] attribute to remove Future boilerplate May 2, 2021
la10736 added a commit that referenced this issue May 2, 2021
la10736 added a commit that referenced this issue May 2, 2021
la10736 added a commit that referenced this issue May 2, 2021
@la10736 la10736 closed this as completed May 2, 2021
la10736 added a commit that referenced this issue May 2, 2021
la10736 added a commit that referenced this issue May 2, 2021
@la10736
Copy link
Owner Author

la10736 commented May 3, 2021

I've released 0.9.0 yesterday.

@svenstaro
Copy link
Contributor

Working perfectly for us, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants