Skip to content

Commit

Permalink
Remove some noqa and adjust test reference files (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
hillairet committed Sep 9, 2023
1 parent 0f9cdeb commit db6c40b
Show file tree
Hide file tree
Showing 34 changed files with 139 additions and 156 deletions.
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce pyflakes(F), pycodestyle(E, W), isort (I), bugbears (B), and pep8-naming (N) rules
select = ["F", "E", "W", "I", "B", "N"]
line-length = 100
exclude = ["tests/exceptions/source"]
exclude = ["tests/exceptions/source/*"]
[pycodestyle]
max-doc-length = 100
4 changes: 2 additions & 2 deletions tests/exceptions/output/diagnose/attributes.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Traceback (most recent call last):

File "tests/exceptions/source/diagnose/attributes.py", line 27, in <module>
File "tests/exceptions/source/diagnose/attributes.py", line 26, in <module>
foo()
└ <function foo at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/attributes.py", line 23, in foo
File "tests/exceptions/source/diagnose/attributes.py", line 22, in foo
... + 1 + bar(a).b + a.forbidden + a.nope.a + x.__bool__ or a. b . isdigit() and .3 + ...
 │ │ │ │ │ │ │ │ └ <method 'isdigit' of 'str' objects>
 │ │ │ │ │ │ │ └ '123'
Expand Down
12 changes: 6 additions & 6 deletions tests/exceptions/output/diagnose/parenthesis.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

Traceback (most recent call last):

File "tests/exceptions/source/diagnose/parenthesis.py", line 48, in <module>
File "tests/exceptions/source/diagnose/parenthesis.py", line 47, in <module>
e()
└ <function e at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/parenthesis.py", line 44, in e
File "tests/exceptions/source/diagnose/parenthesis.py", line 43, in e
) + d(()) + a
 │ └ 1
 └ <function d at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/parenthesis.py", line 37, in d
File "tests/exceptions/source/diagnose/parenthesis.py", line 36, in d
; z = (x * y); y = (j or xyz.val * c() \
 │ │ │ │ │ │ │ └ <function c at 0xDEADBEEF>
 │ │ │ │ │ │ └ 123
Expand All @@ -21,20 +21,20 @@
 │ └ 2
 └ 10

File "tests/exceptions/source/diagnose/parenthesis.py", line 29, in c
File "tests/exceptions/source/diagnose/parenthesis.py", line 28, in c
x.val += 456 and b()
│ │ └ <function b at 0xDEADBEEF>
│ └ 123
└ <__main__.XYZ object at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/parenthesis.py", line 23, in b
File "tests/exceptions/source/diagnose/parenthesis.py", line 22, in b
foo[("baz")] = bar() + (a(5, baz))
│ │ │ └ 0
│ │ └ <function a at 0xDEADBEEF>
│ └ <class '__main__.XYZ'>
└ {}

File "tests/exceptions/source/diagnose/parenthesis.py", line 18, in a
File "tests/exceptions/source/diagnose/parenthesis.py", line 17, in a
(a, b, x.val, ) = 12, 15 / c, 17
 │ │ │ │ └ 0
 │ │ │ └ 9
Expand Down
16 changes: 8 additions & 8 deletions tests/exceptions/output/diagnose/source_multilines.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@

Traceback (most recent call last):

File "tests/exceptions/source/diagnose/source_multilines.py", line 40, in <module>
File "tests/exceptions/source/diagnose/source_multilines.py", line 39, in <module>
bug_1(10)
└ <function bug_1 at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/source_multilines.py", line 13, in bug_1
File "tests/exceptions/source/diagnose/source_multilines.py", line 12, in bug_1
""" + n / 0)

ZeroDivisionError: division by zero

Traceback (most recent call last):

File "tests/exceptions/source/diagnose/source_multilines.py", line 46, in <module>
File "tests/exceptions/source/diagnose/source_multilines.py", line 45, in <module>
bug_2(1, string, 3)
│ └ 'multi-lines\n'
└ <function bug_2 at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/source_multilines.py", line 17, in bug_2
File "tests/exceptions/source/diagnose/source_multilines.py", line 16, in bug_2
return (1 / 0 + a + b + \
 │ └ 'multi-lines\n'
 └ 1
Expand All @@ -26,24 +26,24 @@

Traceback (most recent call last):

File "tests/exceptions/source/diagnose/source_multilines.py", line 52, in <module>
File "tests/exceptions/source/diagnose/source_multilines.py", line 51, in <module>
bug_3(string)
│ └ 'multi-lines\n'
└ <function bug_3 at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/source_multilines.py", line 23, in bug_3
File "tests/exceptions/source/diagnose/source_multilines.py", line 22, in bug_3
, string, 20 / 0)
 └ 'multi-lines\n'

ZeroDivisionError: division by zero

Traceback (most recent call last):

File "tests/exceptions/source/diagnose/source_multilines.py", line 58, in <module>
File "tests/exceptions/source/diagnose/source_multilines.py", line 57, in <module>
bug_4()
└ <function bug_4 at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/source_multilines.py", line 30, in bug_4
File "tests/exceptions/source/diagnose/source_multilines.py", line 29, in bug_4
"bar": a / b,
 │ └ 0
 └ 1
Expand Down
12 changes: 6 additions & 6 deletions tests/exceptions/output/diagnose/syntax_highlighting.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@

Traceback (most recent call last):

File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 32, in <module>
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 31, in <module>
e(0)
└ <function e at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 28, in e
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 27, in e
x in [1], x in (1,), x in {1}, x in {1: 1}, d()
│ │ │ │ └ <function d at 0xDEADBEEF>
│ │ │ └ 0
│ │ └ 0
│ └ 0
└ 0

File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 24, in d
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 23, in d
min(range(1, 10)), list(), dict(), c(), ...
 └ <function c at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 20, in c
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 19, in c
1, 2.5, 3.0, 0.4, "str", r"rrr", rb"binary", b()
 └ <function b at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 16, in b
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 15, in b
a() or False == None != True
└ <function a at 0xDEADBEEF>

File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 12, in a
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 11, in a
1 / 0 + 1 * 0 - 1 % 0 // 1**0 @ 1 # Error

ZeroDivisionError: division by zero
4 changes: 2 additions & 2 deletions tests/exceptions/output/others/exception_in_property.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

Traceback (most recent call last):

File "tests/exceptions/source/others/exception_in_property.py", line 23, in <module>
File "tests/exceptions/source/others/exception_in_property.py", line 22, in <module>
value = a.value
│ └ <property object at 0xDEADBEEF>
└ <__main__.A object at 0xDEADBEEF>

> File "tests/exceptions/source/others/exception_in_property.py", line 14, in value
> File "tests/exceptions/source/others/exception_in_property.py", line 13, in value
1 / 0

ZeroDivisionError: division by zero
60 changes: 30 additions & 30 deletions tests/exceptions/output/others/nested_with_reraise.txt
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@

Traceback (most recent call last):
File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
ZeroDivisionError: division by zero

Traceback (most recent call last):

File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
│ │ └ 0
│ └ 1
└ <function foo at 0xDEADBEEF>

File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
│ └ 0
└ 1

ZeroDivisionError: division by zero

Traceback (most recent call last):
File "tests/exceptions/source/others/nested_with_reraise.py", line 31, in <module>
File "tests/exceptions/source/others/nested_with_reraise.py", line 30, in <module>
baz()
File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
bar(1, 0)
> File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
> File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
ZeroDivisionError: division by zero

Traceback (most recent call last):

File "tests/exceptions/source/others/nested_with_reraise.py", line 31, in <module>
File "tests/exceptions/source/others/nested_with_reraise.py", line 30, in <module>
baz()
└ <function baz at 0xDEADBEEF>

File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
bar(1, 0)
└ <function bar at 0xDEADBEEF>

> File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
> File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
│ │ └ 0
│ └ 1
└ <function foo at 0xDEADBEEF>

File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
│ └ 0
└ 1

ZeroDivisionError: division by zero

Traceback (most recent call last):
File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
ZeroDivisionError: division by zero

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
bar(1, 0)
File "tests/exceptions/source/others/nested_with_reraise.py", line 23, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 22, in bar
raise ValueError from e
ValueError

Traceback (most recent call last):

File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
│ │ └ 0
│ └ 1
└ <function foo at 0xDEADBEEF>

File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
│ └ 0
└ 1
Expand All @@ -92,42 +92,42 @@ The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
bar(1, 0)
└ <function bar at 0xDEADBEEF>

File "tests/exceptions/source/others/nested_with_reraise.py", line 23, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 22, in bar
raise ValueError from e

ValueError

Traceback (most recent call last):
File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
ZeroDivisionError: division by zero

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "tests/exceptions/source/others/nested_with_reraise.py", line 31, in <module>
File "tests/exceptions/source/others/nested_with_reraise.py", line 30, in <module>
baz()
> File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
> File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
bar(1, 0)
File "tests/exceptions/source/others/nested_with_reraise.py", line 23, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 22, in bar
raise ValueError from e
ValueError

Traceback (most recent call last):

File "tests/exceptions/source/others/nested_with_reraise.py", line 21, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 20, in bar
f = foo(x, y)
│ │ └ 0
│ └ 1
└ <function foo at 0xDEADBEEF>

File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
a / b
│ └ 0
└ 1
Expand All @@ -140,15 +140,15 @@ The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "tests/exceptions/source/others/nested_with_reraise.py", line 31, in <module>
File "tests/exceptions/source/others/nested_with_reraise.py", line 30, in <module>
baz()
└ <function baz at 0xDEADBEEF>

> File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
> File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
bar(1, 0)
└ <function bar at 0xDEADBEEF>

File "tests/exceptions/source/others/nested_with_reraise.py", line 23, in bar
File "tests/exceptions/source/others/nested_with_reraise.py", line 22, in bar
raise ValueError from e

ValueError

0 comments on commit db6c40b

Please sign in to comment.