Show More
@@ -115,8 +115,6 b" dedent_re = re.compile('|'.join([" | |||
|
115 | 115 | r'^\s+raise\([^\)]*\).*$', # wacky raise with immediate open paren |
|
116 | 116 | r'^\s+return(\s.*)?$', # normal return (+ space + other stuff, maybe) |
|
117 | 117 | r'^\s+return\([^\)]*\).*$', # wacky return with immediate open paren |
|
118 | r'^\s+yield(\s.*)?$', # normal yield (+ space + other stuff, maybe) | |
|
119 | r'^\s+yield\([^\)]*\).*$', # wacky yield with immediate open paren | |
|
120 | 118 | r'^\s+pass\s*$', # pass (optionally followed by trailing spaces) |
|
121 | 119 | r'^\s+break\s*$', # break (optionally followed by trailing spaces) |
|
122 | 120 | r'^\s+continue\s*$', # continue (optionally followed by trailing spaces) |
@@ -273,20 +273,6 b' class InputSplitterTestCase(unittest.TestCase):' | |||
|
273 | 273 | isp.push('if 1:\n return(0)') |
|
274 | 274 | self.assertEqual(isp.indent_spaces, 0) |
|
275 | 275 | |
|
276 | def test_dedent_yield(self): | |
|
277 | isp = self.isp # shorthand | |
|
278 | # should NOT cause dedent | |
|
279 | isp.push('if 1:\n yielding = 4') | |
|
280 | self.assertEqual(isp.indent_spaces, 4) | |
|
281 | isp.push('if 1:\n yield 5 + 493') | |
|
282 | self.assertEqual(isp.indent_spaces, 0) | |
|
283 | isp.push('if 1:\n yield') | |
|
284 | self.assertEqual(isp.indent_spaces, 0) | |
|
285 | isp.push('if 1:\n yield ') | |
|
286 | self.assertEqual(isp.indent_spaces, 0) | |
|
287 | isp.push('if 1:\n yield(0)') | |
|
288 | self.assertEqual(isp.indent_spaces, 0) | |
|
289 | ||
|
290 | 276 | def test_push(self): |
|
291 | 277 | isp = self.isp |
|
292 | 278 | self.assertTrue(isp.push('x=1')) |
General Comments 0
You need to be logged in to leave comments.
Login now