Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
modules/python: detect debian distutils missing and show an error #9335
modules/python: detect debian distutils missing and show an error #9335
Changes from all commits
2c368b4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, shouldn't this be a unittest assertFalse, not a regular assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When tests are run with
pytest
, either is acceptable. In fact, this simplicity without loss of debugging information is pytest's number one feature.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well yes, but if you don't have both pytest and pytest-xdist then the tests get run without pytest, just unittest, and that is a supported configuration...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same thing in this case, these functions just exist to provide a nicer error output. pytest rewrites the bytecode to replace the asserts with something similar in order to achieve that. It makes sense when you are comparing lists for eg, but as we are just checking a bool, is pretty much the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know what pytest does, thanks.
Again, my point is that we don't depend on pytest (even if we do automatically use it some of the time).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's "pretty much the same thing" to you, it shouldn't be a problem to use unittest asserts for the sake of those odd people using unittest instead of pytest to run this testsuite :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pretty much the same thing because we are just checking a bool, which does not show any extra information, unlike comparing lists for eg.
I just used an assert because that's what I am used to, but I can change it if you want. Though I am not home right now, and have an appointment afterwards, so it might be a couple hours.