Skip to content

Commit 7a5d09e

Browse files
committed
Update test_coroutines for reserved keywords
1 parent afb6316 commit 7a5d09e

1 file changed

Lines changed: 10 additions & 18 deletions

File tree

src/core/IronPython.StdLib/lib/test/test_coroutines.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -394,20 +394,17 @@ def async(): pass
394394
]
395395

396396
for code in samples:
397-
with self.subTest(code=code), self.assertWarnsRegex(
398-
DeprecationWarning,
399-
"'await' will become reserved keywords"):
397+
# ironpython: async/await are reserved keywords
398+
with self.subTest(code=code), self.assertRaises(SyntaxError):
400399
compile(code, "<test>", "exec")
401400

402401
def test_badsyntax_3(self):
403-
with self.assertRaises(DeprecationWarning):
404-
with warnings.catch_warnings():
405-
warnings.simplefilter("error")
406-
compile("async = 1", "<test>", "exec")
407-
408-
def test_goodsyntax_1(self):
409-
# Tests for issue 24619
402+
# ironpython: async/await are reserved keywords
403+
with self.assertRaises(SyntaxError):
404+
compile("async = 1", "<test>", "exec")
410405

406+
# ironpython: async/await are reserved keywords
407+
def test_badsyntax_4(self):
411408
samples = [
412409
'''def foo(await):
413410
async def foo(): pass
@@ -454,14 +451,9 @@ async def bar(): return await_
454451
]
455452

456453
for code in samples:
457-
with self.subTest(code=code):
458-
loc = {}
459-
460-
with warnings.catch_warnings():
461-
warnings.simplefilter("ignore")
462-
exec(code, loc, loc)
463-
464-
self.assertEqual(loc['foo'](10), 11)
454+
# ironpython: async/await are reserved keywords
455+
with self.subTest(code=code), self.assertRaises(SyntaxError):
456+
compile(code, "<test>", "exec")
465457

466458

467459
class TokenizerRegrTest(unittest.TestCase):

0 commit comments

Comments
 (0)