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
ExpectedToFail doesn't work with parametrized tests #762
Comments
I wrote this little example: class ExpectedToFailVsDisabledTest {
@Nested
class WithExpectedToFail {
@ExpectedToFail
@Test
void testSingleFail() {
fail();
}
@ExpectedToFail
@Test
void testSingleSuccess() {
assertTrue(true);
}
@ExpectedToFail
@ParameterizedTest
@ValueSource(booleans = {true, false})
void testParameterizedFail(boolean b) {
fail();
}
@ExpectedToFail
@ParameterizedTest
@ValueSource(booleans = {true, false})
void testParameterizedSuccess(boolean b) {
assertTrue(true);
}
}
@Nested
class WithDisabled {
@Disabled
@Test
void testSingleFail() {
fail();
}
@Disabled
@Test
void testSingleSuccess() {
assertTrue(true);
}
@Disabled
@ParameterizedTest
@ValueSource(booleans = {true, false})
void testParameterizedFail(boolean b) {
fail();
}
@Disabled
@ParameterizedTest
@ValueSource(booleans = {true, false})
void testParameterizedSuccess(boolean b) {
assertTrue(true);
}
}
} It indeed feels strange
Thanks for bringing this to our attention. At the moment, I can't tell if the behaviour is intended. We will discuss this. |
This is an interesting question because I don't think it's straightforward what the annotation is supposed to do if you put it on a |
I think it should:
|
I don't agree. I think when you put I also think it's just a tad too convenient to have |
Hi. I even don't know what to show.
When I put annotation on single test - is ok, but when I use on Parametrized test it doesn't work :(
The text was updated successfully, but these errors were encountered: