diff options
Diffstat (limited to 'Lib/lib2to3/tests/test_parser.py')
-rw-r--r-- | Lib/lib2to3/tests/test_parser.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py index a383a14e30..5bb9d2becb 100644 --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py @@ -48,6 +48,19 @@ class GrammarTest(support.TestCase): raise AssertionError("Syntax shouldn't have been valid") +class TestMatrixMultiplication(GrammarTest): + def test_matrix_multiplication_operator(self): + self.validate("a @ b") + self.validate("a @= b") + + +class TestYieldFrom(GrammarTest): + def test_matrix_multiplication_operator(self): + self.validate("yield from x") + self.validate("(yield from x) + y") + self.invalid_syntax("yield from") + + class TestRaiseChanges(GrammarTest): def test_2x_style_1(self): self.validate("raise") @@ -77,7 +90,7 @@ class TestRaiseChanges(GrammarTest): self.invalid_syntax("raise E from") -# Adaptated from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef +# Adapted from Python 3's Lib/test/test_grammar.py:GrammarTests.testFuncdef class TestFunctionAnnotations(GrammarTest): def test_1(self): self.validate("""def f(x) -> list: pass""") |