mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Test the new error correction feature.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import jedi
|
||||||
from jedi._compatibility import u, is_py3
|
from jedi._compatibility import u, is_py3
|
||||||
from jedi.parser import Parser, load_grammar
|
from jedi.parser import Parser, load_grammar
|
||||||
from jedi.parser.user_context import UserContextParser
|
from jedi.parser.user_context import UserContextParser
|
||||||
@@ -143,3 +144,14 @@ def test_hex_values_in_docstring():
|
|||||||
assert doc == '\xff'
|
assert doc == '\xff'
|
||||||
else:
|
else:
|
||||||
assert doc == u('<EFBFBD>')
|
assert doc == u('<EFBFBD>')
|
||||||
|
|
||||||
|
|
||||||
|
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']
|
||||||
|
|||||||
Reference in New Issue
Block a user