From 0fe872f87aa8b3c7a6a40ed3ec103dbbac8e4245 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 22 Jul 2017 19:21:56 +0200 Subject: [PATCH] A few more tests. --- test/test_python_errors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_python_errors.py b/test/test_python_errors.py index 62ac804..fd564a0 100644 --- a/test/test_python_errors.py +++ b/test/test_python_errors.py @@ -106,6 +106,7 @@ def test_python_exception_matches(code): ('*a, *b = 3, 3', '3.3'), ('*a = 3', '3.5'), ('del *a, b', '3.5'), + ('def x(*): pass', '3.5'), ('async def foo():\n def nofoo():[x async for x in []]', '3.6'), ] ) @@ -180,7 +181,9 @@ def test_named_argument_issues(works_not_in_py): message = works_not_in_py.get_error_message('def foo(*, **dict): pass') message = works_not_in_py.get_error_message('def foo(*): pass') if works_not_in_py.version.startswith('2'): - message + assert message == 'SyntaxError: invalid syntax' + else: + assert message == 'SyntaxError: named arguments must follow bare *' works_not_in_py.assert_no_error_in_passing('def foo(*, name): pass') works_not_in_py.assert_no_error_in_passing('def foo(bar, *, name=1): pass')