| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Without patch
======================================================================
FAIL: test_unloop_break_continue (test.test_compile.TestSpecifics.test_unloop_break_continue) (stmt='break')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/user/oss/cpython/Lib/test/test_compile.py", line 856, in test_unloop_break_continue
self.assertEqual(exc.lineno, 2)
AssertionError: -1 != 2
======================================================================
FAIL: test_unloop_break_continue (test.test_compile.TestSpecifics.test_unloop_break_continue) (stmt='continue')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/user/oss/cpython/Lib/test/test_compile.py", line 856, in test_unloop_break_continue
self.assertEqual(exc.lineno, 2)
AssertionError: -1 != 2
----------------------------------------------------------------------
|
Sorry, something went wrong.
| source = f"with object() as obj:\n {stmt}" | ||
| compile(source, f"<unloop_{stmt}>", "exec") | ||
| exc = err_ctx.exception | ||
| self.assertEqual(exc.lineno, 2) |
There was a problem hiding this comment.
There are some tests for break and continue outside loops in Lib/test/test_syntax.py, I think the lineno check could be added there. For instance, test_break_outside_loop calls self._check_error() but doesn't pass an expected lineno, though it could. And a similar test for continue could be added next to it.
Sorry, something went wrong.
There was a problem hiding this comment.
Done!
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM!
Sorry, something went wrong.
|
Thanks @corona10 for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
|
Sorry, @corona10 and @iritkatriel, I could not cleanly backport this to 3.11 due to a conflict. |
Sorry, something went wrong.
|
Sorry @corona10 and @iritkatriel, I had trouble checking out the 3.10 backport branch. |
Sorry, something went wrong.
|
@iritkatriel I will create the manual backport. |
Sorry, something went wrong.
…continue/break which are not in a loop (pythonGH-101413). (cherry picked from commit e867c1b) Co-authored-by: Dong-hee Na <donghee.na@python.org>
|
GH-101447 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
|
GH-101448 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
…continue/break which are not in a loop (pythonGH-101413). (cherry picked from commit e867c1b) Co-authored-by: Dong-hee Na <donghee.na@python.org>
…continue/break which are not in a loop (pythonGH-101413). (cherry picked from commit e867c1b) Co-authored-by: Dong-hee Na <donghee.na@python.org>
…e/break which are not in a loop (python#101413)
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.