From f8570b1f0367e96ad403734e0910ca0bdb585ea3 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 9 Jan 2015 18:02:00 +0100 Subject: [PATCH] Test for error recovery with try statements. --- test/completion/invalid.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/completion/invalid.py b/test/completion/invalid.py index a014f0a8..9a5ce319 100644 --- a/test/completion/invalid.py +++ b/test/completion/invalid.py @@ -186,3 +186,28 @@ invalid invalid = ,call #? invalid + + +# ----------------- +# classes +# ----------------- + +class BrokenPartsOfClass(): + def foo(self): + # This construct contains two places where Jedi with Python 3 can fail. + # It should just ignore those constructs and still execute `bar`. + pass + if 2: + try: + pass + except ValueError, e: + raise TypeError, e + else: + pass + + def bar(self): + self.x = 3 + return '' + +#? str() +BrokenPartsOfClass().bar()