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

Forbid return values from test and lifecycle methods #835

Closed
1 task done
sbrannen opened this issue May 4, 2017 · 2 comments
Closed
1 task done

Forbid return values from test and lifecycle methods #835

sbrannen opened this issue May 4, 2017 · 2 comments

Comments

@sbrannen
Copy link
Member

sbrannen commented May 4, 2017

Status Quo

In the JUnit Jupiter programming model it is currently not forbidden for @Test and lifecycle methods (i.e., @BeforeEach, @BeforeAll, etc.) to have a return value, even if it's assumed that no one declares anything other than void as a return type for such methods.

For example, the following currently execute.

@Test
int test() {
	fail("Boom!");
	return 42;
}
@BeforeEach
int before() {
	fail("Boom!");
	return 42;
}

Related Issues

Deliverables

  • Forbid return values from test and lifecycle methods via test predicates that exclude such methods.
@marcphilipp
Copy link
Member

Team decision: Forbid via test predicates that exclude such methods.

@marcphilipp marcphilipp modified the milestones: 5.0 M6, 5.0 M5 May 5, 2017
@sbrannen sbrannen changed the title Decide how to handle return values from test and lifecycle methods Forbid return values from test and lifecycle methods Jul 3, 2017
@mmerdes mmerdes self-assigned this Jul 6, 2017
@mmerdes
Copy link
Contributor

mmerdes commented Jul 7, 2017

in progress

mmerdes pushed a commit that referenced this issue Jul 13, 2017
These modifieres were removed in a cleanup issue a while ago but should
in fact be tested explicitly.

#835
mmerdes pushed a commit that referenced this issue Jul 13, 2017
mmerdes pushed a commit that referenced this issue Jul 14, 2017
mmerdes pushed a commit that referenced this issue Jul 14, 2017
mmerdes pushed a commit that referenced this issue Jul 14, 2017
These modifieres were removed in a cleanup issue a while ago but should
in fact be tested explicitly.

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

No branches or pull requests

3 participants