diff Lib/test/test_parser.py @ 76818:fc17f70292f6 3.2

Issue #14701: Add missing support for 'raise ... from' in parser module.
author Mark Dickinson <mdickinson@enthought.com>
date Mon, 07 May 2012 12:01:27 +0100
parents b7e491b9094f
children 129289144dfb 0dd0d56bdcc1
line wrap: on
line diff
--- a/Lib/test/test_parser.py	Mon May 07 10:24:02 2012 +0100
+++ b/Lib/test/test_parser.py	Mon May 07 12:01:27 2012 +0100
@@ -297,6 +297,14 @@
         self.check_suite("[*a, *b] = y")
         self.check_suite("for [*x, b] in x: pass")
 
+    def test_raise_statement(self):
+        self.check_suite("raise\n")
+        self.check_suite("raise e\n")
+        self.check_suite("try:\n"
+                         "    suite\n"
+                         "except Exception as e:\n"
+                         "    raise ValueError from e\n")
+
 
 #
 #  Second, we take *invalid* trees and make sure we get ParserError