-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b5b86a
commit 6eb9545
Showing
5 changed files
with
83 additions
and
51 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
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
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
44 changes: 44 additions & 0 deletions
44
...napshots/ruff_linter__rules__pylint__tests__PLE0308_invalid_return_type_bytes.py.snap.new
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,44 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pylint/mod.rs | ||
assertion_line: 218 | ||
--- | ||
invalid_return_type_bytes.py:6:16: PLE0308 `__bytes__` does not return `bytes` | ||
| | ||
4 | class Float: | ||
5 | def __bytes__(self): | ||
6 | return 3.05 # [invalid-bytes-return] | ||
| ^^^^ PLE0308 | ||
| | ||
|
||
invalid_return_type_bytes.py:11:16: PLE0308 `__bytes__` does not return `bytes` | ||
| | ||
9 | class Int: | ||
10 | def __bytes__(self): | ||
11 | return 0 # [invalid-bytes-return] | ||
| ^ PLE0308 | ||
| | ||
|
||
invalid_return_type_bytes.py:16:16: PLE0308 `__bytes__` does not return `bytes` | ||
| | ||
14 | class Str: | ||
15 | def __bytes__(self): | ||
16 | return "some bytes" # [invalid-bytes-return] | ||
| ^^^^^^^^^^^^ PLE0308 | ||
| | ||
|
||
invalid_return_type_bytes.py:20:9: PLE0308 `__bytes__` does not return `bytes` | ||
| | ||
19 | class BytesNoReturn: | ||
20 | def __bytes__(self): | ||
| ^^^^^^^^^ PLE0308 | ||
21 | print("ruff") # [invalid-bytes-return] | ||
| | ||
|
||
invalid_return_type_bytes.py:25:9: PLE0308 `__bytes__` does not return `bytes` | ||
| | ||
24 | class BytesWrongRaise: | ||
25 | def __bytes__(self): | ||
| ^^^^^^^^^ PLE0308 | ||
26 | print("raise some error") | ||
27 | raise NotImplementedError # [invalid-bytes-return] | ||
| |
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