mgattozzi/assay

Macro does not respect `#[ignore]` attribute

korrat opened this issue · 3 comments

With the following code, I get an error when running tests with cargo test:

#[assay]
#[ignore]
fn fail() {
    panic!();
}

The output is:

$ cargo test
[...]
running 1 test
test fail ... FAILED

I expected the test to be ignored.

The equivalent code using #[test] does not cause a test failure.

#[test]
#[ignore]
fn fail() {
    panic!();
}

Cargo output:

$ cargo test
[...]
running 1 test
test fail ... ignored

Context

I was trying to run proptest tests under assay. Since they take a few seconds to run each, I was trying to ignore them, which is how I discovered the problem.

Hey @korrat thanks for opening up this issue! I can add something like should_panic in assay that applies an ignore attribute so something like

#[assay(ignore)]

but also have it respect other attributes that get applied

That sounds good. If you'd like, I can also try my hand on that and open a PR on the weekend.

@korrat If you want to contribute feel free! There's no pressure to do so though 😄