-
Notifications
You must be signed in to change notification settings - Fork 718
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix repeated line not detected during exception formatting (#1239)
- Loading branch information
Showing
8 changed files
with
739 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
|
||
Traceback (most recent call last): | ||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <module> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
[Previous line repeated 8 more times] | ||
ZeroDivisionError: division by zero | ||
|
||
Traceback (most recent call last): | ||
> File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <module> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
[Previous line repeated 8 more times] | ||
ZeroDivisionError: division by zero | ||
|
||
[33m[1mTraceback (most recent call last):[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mone_liner_recursion.py[0m", line [33m14[0m, in [35m<module>[0m | ||
[1mrec[0m [35m[1m=[0m [35m[1mlambda[0m [1mr[0m[1m,[0m [1mi[0m[1m:[0m [34m[1m1[0m [35m[1m/[0m [34m[1m0[0m [35m[1mif[0m [1mi[0m [35m[1m==[0m [34m[1m0[0m [35m[1melse[0m [1mr[0m[1m([0m[1mr[0m[1m,[0m [1mi[0m [35m[1m-[0m [34m[1m1[0m[1m)[0m[1m;[0m [1mrec[0m[1m([0m[1mrec[0m[1m,[0m [34m[1m10[0m[1m)[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mone_liner_recursion.py[0m", line [33m14[0m, in [35m<lambda>[0m | ||
[1mrec[0m [35m[1m=[0m [35m[1mlambda[0m [1mr[0m[1m,[0m [1mi[0m[1m:[0m [34m[1m1[0m [35m[1m/[0m [34m[1m0[0m [35m[1mif[0m [1mi[0m [35m[1m==[0m [34m[1m0[0m [35m[1melse[0m [1mr[0m[1m([0m[1mr[0m[1m,[0m [1mi[0m [35m[1m-[0m [34m[1m1[0m[1m)[0m[1m;[0m [1mrec[0m[1m([0m[1mrec[0m[1m,[0m [34m[1m10[0m[1m)[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mone_liner_recursion.py[0m", line [33m14[0m, in [35m<lambda>[0m | ||
[1mrec[0m [35m[1m=[0m [35m[1mlambda[0m [1mr[0m[1m,[0m [1mi[0m[1m:[0m [34m[1m1[0m [35m[1m/[0m [34m[1m0[0m [35m[1mif[0m [1mi[0m [35m[1m==[0m [34m[1m0[0m [35m[1melse[0m [1mr[0m[1m([0m[1mr[0m[1m,[0m [1mi[0m [35m[1m-[0m [34m[1m1[0m[1m)[0m[1m;[0m [1mrec[0m[1m([0m[1mrec[0m[1m,[0m [34m[1m10[0m[1m)[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mone_liner_recursion.py[0m", line [33m14[0m, in [35m<lambda>[0m | ||
[1mrec[0m [35m[1m=[0m [35m[1mlambda[0m [1mr[0m[1m,[0m [1mi[0m[1m:[0m [34m[1m1[0m [35m[1m/[0m [34m[1m0[0m [35m[1mif[0m [1mi[0m [35m[1m==[0m [34m[1m0[0m [35m[1melse[0m [1mr[0m[1m([0m[1mr[0m[1m,[0m [1mi[0m [35m[1m-[0m [34m[1m1[0m[1m)[0m[1m;[0m [1mrec[0m[1m([0m[1mrec[0m[1m,[0m [34m[1m10[0m[1m)[0m | ||
[Previous line repeated 8 more times] | ||
[31m[1mZeroDivisionError[0m:[1m division by zero[0m | ||
|
||
Traceback (most recent call last): | ||
|
||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <module> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
│ └ <function <lambda> at 0xDEADBEEF> | ||
└ <function <lambda> at 0xDEADBEEF> | ||
|
||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
│ │ │ │ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ │ │ └ 10 | ||
│ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ └ 10 | ||
│ └ 10 | ||
└ <function <lambda> at 0xDEADBEEF> | ||
|
||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
│ │ │ │ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ │ │ └ 9 | ||
│ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ └ 9 | ||
│ └ 9 | ||
└ <function <lambda> at 0xDEADBEEF> | ||
|
||
File "tests/exceptions/source/others/one_liner_recursion.py", line 14, in <lambda> | ||
rec = lambda r, i: 1 / 0 if i == 0 else r(r, i - 1); rec(rec, 10) | ||
│ │ │ │ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ │ │ └ 8 | ||
│ │ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ │ └ <function <lambda> at 0xDEADBEEF> | ||
│ │ └ 8 | ||
│ └ 8 | ||
└ <function <lambda> at 0xDEADBEEF> | ||
[Previous line repeated 8 more times] | ||
|
||
ZeroDivisionError: division by zero |
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,57 @@ | ||
|
||
Traceback (most recent call last): | ||
File "tests/exceptions/source/others/recursion_error.py", line 19, in <module> | ||
recursive() | ||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
[Previous line repeated 996 more times] | ||
RecursionError: maximum recursion depth exceeded | ||
|
||
Traceback (most recent call last): | ||
> File "tests/exceptions/source/others/recursion_error.py", line 19, in <module> | ||
recursive() | ||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
[Previous line repeated 996 more times] | ||
RecursionError: maximum recursion depth exceeded | ||
|
||
[33m[1mTraceback (most recent call last):[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mrecursion_error.py[0m", line [33m19[0m, in [35m<module>[0m | ||
[1mrecursive[0m[1m([0m[1m)[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mrecursion_error.py[0m", line [33m15[0m, in [35mrecursive[0m | ||
[1mrecursive[0m[1m([0m[1m)[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mrecursion_error.py[0m", line [33m15[0m, in [35mrecursive[0m | ||
[1mrecursive[0m[1m([0m[1m)[0m | ||
File "[32mtests/exceptions/source/others/[0m[32m[1mrecursion_error.py[0m", line [33m15[0m, in [35mrecursive[0m | ||
[1mrecursive[0m[1m([0m[1m)[0m | ||
[Previous line repeated 996 more times] | ||
[31m[1mRecursionError[0m:[1m maximum recursion depth exceeded[0m | ||
|
||
Traceback (most recent call last): | ||
|
||
File "tests/exceptions/source/others/recursion_error.py", line 19, in <module> | ||
recursive() | ||
└ <function recursive at 0xDEADBEEF> | ||
|
||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
└ <function recursive at 0xDEADBEEF> | ||
|
||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
└ <function recursive at 0xDEADBEEF> | ||
|
||
File "tests/exceptions/source/others/recursion_error.py", line 15, in recursive | ||
recursive() | ||
└ <function recursive at 0xDEADBEEF> | ||
[Previous line repeated 996 more times] | ||
|
||
RecursionError: maximum recursion depth exceeded |
Oops, something went wrong.