From ef72f4fb6cb4356ce889d2e636c4d4d7caa88eff Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 12 Jan 2015 01:27:25 +0100 Subject: [PATCH] Test the new error correction feature. --- test/test_parser/test_parser.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_parser/test_parser.py b/test/test_parser/test_parser.py index 3b43a80f..d17a7f6f 100644 --- a/test/test_parser/test_parser.py +++ b/test/test_parser/test_parser.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +import jedi from jedi._compatibility import u, is_py3 from jedi.parser import Parser, load_grammar from jedi.parser.user_context import UserContextParser @@ -143,3 +144,14 @@ def test_hex_values_in_docstring(): assert doc == '\xff' else: assert doc == u('�') + + +def test_error_correction_with(): + source = """ + with open() as f: + try: + f.""" + comps = jedi.Script(source).completions() + assert len(comps) > 40 + # `open` completions have a closed attribute. + assert [1 for c in comps if c.name == 'closed']