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.
Summary
While working on #3596 , I saw that a handful of tests on
DaskKubernetesEnvironment
looked like they were accidentally missing anassert
.This PR fixes those and other tests in
tests/
, so that they'll fail when they should.Changes
Added
assert
to a few comparisons intests/
that looked like they were intended to be test cases that fail ifFalse
.Importance
The changes in this PR ensure that tests that fail do so loudly, so that problematic changes to the code they cover don't accidentally get merged.
Checklist
This PR:
changes/
directory (if appropriate)docs/outline.toml
for API reference docs (if appropriate)Notes for reviewers
After noticing this working on #3596 , I searched for other cases with
pylint
:pylint tests/ | grep expression-not-assigned
pylint logs with duplicates removed (click me)
Even if you don't want to take on all of
pylint
, I think it would be worth enabling just this check inprefect
's continuous integration jobs. It catches the types of issues that are easy for human reviewers to miss, and which can allow bugs inprefect
to slip through the review process.I think it would be a good idea to start adding
pylint
to your CI, with PRs that add one or two important error codes at a time to.pylintrc
, to catch issues like this. The style thingspylint
catches are a matter of taste and not that important, but I've found in my projects that it catches code-correctness things thatflake8
doesn't (for example: #3041, #3307).Thanks for your time and consideration.