1
0
forked from VimPlug/jedi

Use split_lines and python_bytes_to_unicode directly.

This commit is contained in:
Dave Halter
2017-09-03 18:38:00 +02:00
17 changed files with 327 additions and 49 deletions

View File

@@ -2,7 +2,6 @@
Tests of ``jedi.api.Interpreter``.
"""
from ..helpers import TestCase
import jedi
from jedi._compatibility import is_py33
from jedi.evaluate.compiled import mixed
@@ -178,16 +177,37 @@ def test_getitem_side_effects():
_assert_interpreter_complete('foo[0].', locals(), [])
def test_property_error():
def test_property_error_oldstyle():
lst = []
class Foo3():
@property
def bar(self):
lst.append(1)
raise ValueError
foo = Foo3()
_assert_interpreter_complete('foo.bar', locals(), ['bar'])
_assert_interpreter_complete('foo.bar.baz', locals(), [])
# There should not be side effects
assert lst == []
def test_property_error_newstyle():
lst = []
class Foo3(object):
@property
def bar(self):
lst.append(1)
raise ValueError
foo = Foo3()
_assert_interpreter_complete('foo.bar', locals(), ['bar'])
_assert_interpreter_complete('foo.bar.baz', locals(), [])
# There should not be side effects
assert lst == []
def test_param_completion():
def foo(bar):