-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Direct assert rule to ignore asserts in test functions
For several Python test frameworks, the assert builtin is required to validate the test. Precli should avoid showing results for this condition since this isn't the use case the rule is trying to find. Fixes: #638 Signed-off-by: Eric Brown <[email protected]>
- Loading branch information
Showing
3 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
tests/unit/rules/python/stdlib/assert/examples/assert_test_func.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# level: NONE | ||
def test_foobar(a: str = None): | ||
assert a is not None | ||
return f"Hello {a}" | ||
|
||
|
||
foobar(None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters