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

Some tests misusing assertTrue for comparisons #2129

Closed
code-review-doctor opened this issue Feb 15, 2022 · 0 comments · Fixed by #2130
Closed

Some tests misusing assertTrue for comparisons #2129

code-review-doctor opened this issue Feb 15, 2022 · 0 comments · Fixed by #2130
Labels
python Pull requests that update Python code type: maintenance
Milestone

Comments

@code-review-doctor
Copy link
Contributor

assertTrue is not for comparing arguments, should use assertEqual for that.

The developer's intent of the test was to compare argument 1 with argument 2, which is not happening. Really what is happening is the test is passing because first argument is truthy. The correct method to use is assertEqual. more details

self.assertTrue(rv.status_code, 200)

self.assertTrue(rv.status_code, 200)

self.assertTrue(rv.status_code, 200)

self.assertTrue(rv.status_code, 200)

I found this issue automatically, see other issues here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code type: maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants