Skip to content
Merged
Prev Previous commit
Next Next commit
Update test_dictcomps, test_genexps and test_generators
  • Loading branch information
pablogsal committed May 15, 2020
commit 00a2205b87f8a43358407212241a4fc0f6e82af3
2 changes: 1 addition & 1 deletion Lib/test/test_dictcomps.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_illegal_assignment(self):
compile("{x: y for y, x in ((1, 2), (3, 4))} = 5", "<test>",
"exec")

with self.assertRaisesRegex(SyntaxError, "cannot assign"):
with self.assertRaisesRegex(SyntaxError, "illegal expression"):
compile("{x: y for y, x in ((1, 2), (3, 4))} += 5", "<test>",
"exec")

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,7 @@ def printsolution(self, x):
>>> def f(): (yield bar) += y
Traceback (most recent call last):
...
SyntaxError: cannot assign to yield expression
SyntaxError: yield expression is an illegal expression for augmented assignment
Comment thread
pablogsal marked this conversation as resolved.
Outdated


Now check some throw() conditions:
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_genexps.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
>>> (y for y in (1,2)) += 10
Traceback (most recent call last):
...
SyntaxError: cannot assign to generator expression
SyntaxError: generator expression is an illegal expression for augmented assignment
Comment thread
pablogsal marked this conversation as resolved.
Outdated


########### Tests borrowed from or inspired by test_generators.py ############
Expand Down