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

Test Smell: it is not a good practice to write a return statement in the test case #2797

Open
TestSmell opened this issue Aug 29, 2022 · 3 comments

Comments

@TestSmell
Copy link

Hi!
I notice that you write a test case with a return statement.
For example,
image

It is not a good idea to write the return statement in your test case based on the definition of the test case.
So I would like to know if is it really a useful test case? And no assertion is in this test case.
Maybe I think you should remove this test case from your test code. Thanks.

@juherr
Copy link
Member

juherr commented Aug 29, 2022

Right. It may be one of the first tests when the current best practices didn't exist.

The cannot be removed because I think there is not yet a warning against this practice.

You can propose a pull request that adds a warning message.
You can add a "for removal" tag to related tests.

@rajasu8
Copy link

rajasu8 commented Aug 8, 2023

@juherr can I take this?

@juherr
Copy link
Member

juherr commented Aug 8, 2023

@rajasu8 sure. Go ahead 👍

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