Skip to content

Commit db6c40b

Browse files
authored
Remove some noqa and adjust test reference files (#982)
1 parent 0f9cdeb commit db6c40b

34 files changed

+139
-156
lines changed

ruff.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce pyflakes(F), pycodestyle(E, W), isort (I), bugbears (B), and pep8-naming (N) rules
22
select = ["F", "E", "W", "I", "B", "N"]
33
line-length = 100
4-
exclude = ["tests/exceptions/source"]
4+
exclude = ["tests/exceptions/source/*"]
55
[pycodestyle]
66
max-doc-length = 100

tests/exceptions/output/diagnose/attributes.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
Traceback (most recent call last):
33

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

8-
File "tests/exceptions/source/diagnose/attributes.py", line 23, in foo
8+
File "tests/exceptions/source/diagnose/attributes.py", line 22, in foo
99
... + 1 + bar(a).b + a.forbidden + a.nope.a + x.__bool__ or a. b . isdigit() and .3 + ...
1010
 │ │ │ │ │ │ │ │ └ <method 'isdigit' of 'str' objects>
1111
 │ │ │ │ │ │ │ └ '123'

tests/exceptions/output/diagnose/parenthesis.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

22
Traceback (most recent call last):
33

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

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

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

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

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

37-
File "tests/exceptions/source/diagnose/parenthesis.py", line 18, in a
37+
File "tests/exceptions/source/diagnose/parenthesis.py", line 17, in a
3838
(a, b, x.val, ) = 12, 15 / c, 17
3939
 │ │ │ │ └ 0
4040
 │ │ │ └ 9

tests/exceptions/output/diagnose/source_multilines.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11

22
Traceback (most recent call last):
33

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

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

1111
ZeroDivisionError: division by zero
1212

1313
Traceback (most recent call last):
1414

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

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

2727
Traceback (most recent call last):
2828

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

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

3838
ZeroDivisionError: division by zero
3939

4040
Traceback (most recent call last):
4141

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

46-
File "tests/exceptions/source/diagnose/source_multilines.py", line 30, in bug_4
46+
File "tests/exceptions/source/diagnose/source_multilines.py", line 29, in bug_4
4747
"bar": a / b,
4848
 │ └ 0
4949
 └ 1
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11

22
Traceback (most recent call last):
33

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

8-
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 28, in e
8+
File "tests/exceptions/source/diagnose/syntax_highlighting.py", line 27, in e
99
x in [1], x in (1,), x in {1}, x in {1: 1}, d()
1010
│ │ │ │ └ <function d at 0xDEADBEEF>
1111
│ │ │ └ 0
1212
│ │ └ 0
1313
│ └ 0
1414
└ 0
1515

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

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

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

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

3131
ZeroDivisionError: division by zero
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
Traceback (most recent call last):
33

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

9-
> File "tests/exceptions/source/others/exception_in_property.py", line 14, in value
9+
> File "tests/exceptions/source/others/exception_in_property.py", line 13, in value
1010
1 / 0
1111

1212
ZeroDivisionError: division by zero
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
11

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

99
Traceback (most recent call last):
1010

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

17-
File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
17+
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
1818
a / b
1919
│ └ 0
2020
└ 1
2121

2222
ZeroDivisionError: division by zero
2323

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

3535
Traceback (most recent call last):
3636

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

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

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

51-
File "tests/exceptions/source/others/nested_with_reraise.py", line 15, in foo
51+
File "tests/exceptions/source/others/nested_with_reraise.py", line 14, in foo
5252
a / b
5353
│ └ 0
5454
└ 1
5555

5656
ZeroDivisionError: division by zero
5757

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

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

6767
Traceback (most recent call last):
68-
File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
68+
File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
6969
bar(1, 0)
70-
File "tests/exceptions/source/others/nested_with_reraise.py", line 23, in bar
70+
File "tests/exceptions/source/others/nested_with_reraise.py", line 22, in bar
7171
raise ValueError from e
7272
ValueError
7373

7474
Traceback (most recent call last):
7575

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

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

9393
Traceback (most recent call last):
9494

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

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

102102
ValueError
103103

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

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

113113
Traceback (most recent call last):
114-
File "tests/exceptions/source/others/nested_with_reraise.py", line 31, in <module>
114+
File "tests/exceptions/source/others/nested_with_reraise.py", line 30, in <module>
115115
baz()
116-
> File "tests/exceptions/source/others/nested_with_reraise.py", line 27, in baz
116+
> File "tests/exceptions/source/others/nested_with_reraise.py", line 26, in baz
117117
bar(1, 0)
118-
File "tests/exceptions/source/others/nested_with_reraise.py", line 23, in bar
118+
File "tests/exceptions/source/others/nested_with_reraise.py", line 22, in bar
119119
raise ValueError from e
120120
ValueError
121121

122122
Traceback (most recent call last):
123123

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

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

141141
Traceback (most recent call last):
142142

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

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

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

154154
ValueError

0 commit comments

Comments
 (0)