-
Notifications
You must be signed in to change notification settings - Fork 43
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 #[ignore] attribute to ignore test arguments #267
Conversation
rstest_macros/src/parse/ignore.rs
Outdated
#[rstest] | ||
#[case::no_more_than_one("fn f(#[ignore] #[ignore] a: u32) {}", "more than once")] | ||
fn raise_error(#[case] item_fn: &str, #[case] message: &str) { | ||
let mut item_fn: ItemFn = item_fn.ast(); | ||
|
||
let err = extract_ignores(&mut item_fn).unwrap_err(); | ||
|
||
assert_in!(format!("{:?}", err), message); | ||
} | ||
} |
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.
Use rstest
here is a little bit overkill ... but is fine 😄
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 copied it from the by_ref implementation...converted to a simple test 👍
/// | ||
/// ## Ignoring Arguments | ||
/// | ||
/// Sometimes, you may want to inject and use fixtures not managed by rstest |
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.
Just a note: please can you add a little note in Inject Test Attribute with a link to this section?
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.
added 👍
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.
That's a greate job. I just ask you to add a little note in the test inject attribute section to recall this feature.... I guess that allmost of the peaple will find it usefull.
If you don't have time nevermid about this... Let me know and I'll do it by myself.
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.
Thx again!!!!
Great job.
LGTM
Added the
#[ignore]
attribute to allow to ignore test arguments and let other crates (e.g. sqlx test runner or other proc macros) take care of them.Fixes #228 and #91
Developed during