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

Unnecessary verification #738

Open
ghost opened this issue Sep 22, 2023 · 0 comments
Open

Unnecessary verification #738

ghost opened this issue Sep 22, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 22, 2023

Describe the bug
While searching for a vulnerability error in sqlparse, I found one assert that does not affect (in my opinion) anything, because if you comment it and run tests, they pass without errors and also the example code also pass without errors
Here is the link to the code:

assert end is None

To Reproduce
In order to check this, comment out this line and run the tests in any way (with the tox or pytest command) and see that the tests are being passed

Expected behavior
If this check would have made sense then at least one test should have fallen)

Versions (please complete the following information):

  • Python: [e.g. 3.11.5]
  • sqlparse: [e.g. 0.5.0.dev0]

Additional context
If this check still turns out to be necessary, it is better to get rid of the asserts in the code (assert is performed only in debug mode or in tests) and add an if condition. I can send a PR with an update

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

No branches or pull requests

0 participants