forked from VimPlug/jedi
Get rid of deprecations in tests
This commit is contained in:
@@ -316,7 +316,8 @@ def test_signature_is_definition(Script):
|
||||
# Now compare all the attributes that a Signature must also have.
|
||||
for attr_name in dir(definition):
|
||||
dont_scan = ['defined_names', 'parent', 'goto_assignments', 'infer',
|
||||
'params', 'get_signatures', 'execute', 'goto']
|
||||
'params', 'get_signatures', 'execute', 'goto',
|
||||
'desc_with_module']
|
||||
if attr_name.startswith('_') or attr_name in dont_scan:
|
||||
continue
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ def test_hashlib_params(Script, environment):
|
||||
if environment.version_info < (3,):
|
||||
pytest.skip()
|
||||
|
||||
script = Script(source='from hashlib import sha256')
|
||||
script = Script('from hashlib import sha256')
|
||||
c, = script.complete()
|
||||
sig, = c.get_signatures()
|
||||
assert [p.name for p in sig.params] == ['arg']
|
||||
|
||||
@@ -92,11 +92,11 @@ def test_complete_expanduser(Script):
|
||||
non_dots = [p for p in possibilities if not p.name.startswith('.') and len(p.name) > 1]
|
||||
item = non_dots[0]
|
||||
line = "'~%s%s'" % (os.sep, item.name)
|
||||
s = Script(line, line=1, column=len(line)-1)
|
||||
s = Script(line)
|
||||
expected_name = item.name
|
||||
if item.is_dir():
|
||||
expected_name += os.path.sep
|
||||
assert expected_name in [c.name for c in s.completions()]
|
||||
assert expected_name in [c.name for c in s.completions(column=len(line)-1)]
|
||||
|
||||
|
||||
def test_fake_subnodes(Script):
|
||||
|
||||
@@ -74,9 +74,3 @@ def test_wrong_encoding(Script, tmpdir):
|
||||
project = Project('.', sys_path=[tmpdir.strpath])
|
||||
c, = Script('import x; x.foo', project=project).complete()
|
||||
assert c.name == 'foobar'
|
||||
|
||||
|
||||
def test_encoding_parameter(Script):
|
||||
name = u('hö')
|
||||
s = Script(name.encode('latin-1'), encoding='latin-1')
|
||||
assert s._module_node.get_code() == name
|
||||
|
||||
Reference in New Issue
Block a user