Skip to content

Commit

Permalink
Merge pull request #94 from palfrey/remove-ignore-ignore
Browse files Browse the repository at this point in the history
Stop stripping ignore/should_panic attributes
  • Loading branch information
palfrey authored Feb 24, 2023
2 parents 7d6af09 + fc0497c commit 21b7a7f
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions serial_test_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,7 @@ where
syn::ReturnType::Type(_rarrow, ref box_type) => Some(box_type.deref()),
};
let block = ast.block;
let attrs: Vec<syn::Attribute> = ast
.attrs
.into_iter()
.filter(|at| {
if let Ok(m) = at.parse_meta() {
let path = m.path();
// we skip ignore/should_panic because the test framework already deals with it
!(path.is_ident("ignore") || path.is_ident("should_panic"))
} else {
true
}
})
.collect();
let attrs: Vec<syn::Attribute> = ast.attrs.into_iter().collect();
if let Some(ret) = return_type {
match asyncness {
Some(_) => {
Expand Down Expand Up @@ -461,7 +449,7 @@ mod tests {
}

#[test]
fn test_stripped_attributes() {
fn test_other_attributes() {
let _ = env_logger::builder().is_test(true).try_init();
let attrs = proc_macro2::TokenStream::new();
let input = quote! {
Expand All @@ -474,6 +462,8 @@ mod tests {
let stream = local_serial_core(attrs.into(), input);
let compare = quote! {
#[test]
#[ignore]
#[should_panic(expected = "Testing panic")]
#[something_else]
fn foo () {
serial_test::local_serial_core("", || {} );
Expand Down

0 comments on commit 21b7a7f

Please sign in to comment.