mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
Make some test code prettier
This commit is contained in:
@@ -8,7 +8,7 @@ import pytest
|
|||||||
|
|
||||||
import jedi
|
import jedi
|
||||||
from jedi._compatibility import is_py3, py_version
|
from jedi._compatibility import is_py3, py_version
|
||||||
from jedi.inference.compiled import mixed, value
|
from jedi.inference.compiled import mixed
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
|
|
||||||
if py_version > 30:
|
if py_version > 30:
|
||||||
@@ -78,8 +78,8 @@ def test_numpy_like_non_zero():
|
|||||||
|
|
||||||
# just assert these do not raise. They (strangely) trigger different
|
# just assert these do not raise. They (strangely) trigger different
|
||||||
# codepath
|
# codepath
|
||||||
get_completion('d["a"].some', {'d':d})
|
get_completion('d["a"].some', {'d': d})
|
||||||
get_completion('x.some', {'x':x})
|
get_completion('x.some', {'x': x})
|
||||||
|
|
||||||
|
|
||||||
def test_nested_resolve():
|
def test_nested_resolve():
|
||||||
@@ -255,6 +255,7 @@ def allow_unsafe_getattr(request, monkeypatch):
|
|||||||
|
|
||||||
def test_property_error_oldstyle(allow_unsafe_getattr):
|
def test_property_error_oldstyle(allow_unsafe_getattr):
|
||||||
lst = []
|
lst = []
|
||||||
|
|
||||||
class Foo3:
|
class Foo3:
|
||||||
@property
|
@property
|
||||||
def bar(self):
|
def bar(self):
|
||||||
@@ -274,6 +275,7 @@ def test_property_error_oldstyle(allow_unsafe_getattr):
|
|||||||
|
|
||||||
def test_property_error_newstyle(allow_unsafe_getattr):
|
def test_property_error_newstyle(allow_unsafe_getattr):
|
||||||
lst = []
|
lst = []
|
||||||
|
|
||||||
class Foo3(object):
|
class Foo3(object):
|
||||||
@property
|
@property
|
||||||
def bar(self):
|
def bar(self):
|
||||||
@@ -375,9 +377,9 @@ def test_more_complex_instances():
|
|||||||
def wow(self):
|
def wow(self):
|
||||||
return Something()
|
return Something()
|
||||||
|
|
||||||
#script = jedi.Interpreter('Base().wow().foo', [locals()])
|
script = jedi.Interpreter('Base().wow().foo', [locals()])
|
||||||
#c, = script.complete()
|
c, = script.complete()
|
||||||
#assert c.name == 'foo'
|
assert c.name == 'foo'
|
||||||
|
|
||||||
x = Base()
|
x = Base()
|
||||||
script = jedi.Interpreter('x.wow().foo', [locals()])
|
script = jedi.Interpreter('x.wow().foo', [locals()])
|
||||||
@@ -514,7 +516,7 @@ def test__wrapped__():
|
|||||||
|
|
||||||
@lru_cache(maxsize=128)
|
@lru_cache(maxsize=128)
|
||||||
def syslogs_to_df():
|
def syslogs_to_df():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
c, = jedi.Interpreter('syslogs_to_df', [locals()]).complete()
|
c, = jedi.Interpreter('syslogs_to_df', [locals()]).complete()
|
||||||
# Apparently the function starts on the line where the decorator starts.
|
# Apparently the function starts on the line where the decorator starts.
|
||||||
|
|||||||
Reference in New Issue
Block a user