Fix some tests

This commit is contained in:
Dave Halter
2019-04-03 01:04:18 +02:00
parent fa17681cf6
commit f4a6856e54
3 changed files with 12 additions and 12 deletions

View File

@@ -7,7 +7,6 @@ import pytest
from ..helpers import TestCase
from jedi import cache
from jedi.parser_utils import get_call_signature
from jedi._compatibility import is_py3
def assert_signature(Script, source, expected_name, expected_index=0, line=None, column=None):
@@ -308,18 +307,16 @@ def test_signature_is_definition(Script):
# Now compare all the attributes that a CallSignature must also have.
for attr_name in dir(definition):
dont_scan = ['defined_names', 'parent', 'goto_assignments', 'params']
dont_scan = ['defined_names', 'parent', 'goto_assignments', 'infer', 'params']
if attr_name.startswith('_') or attr_name in dont_scan:
continue
# Might trigger some deprecation warnings.
with warnings.catch_warnings(record=True):
attribute = getattr(definition, attr_name)
signature_attribute = getattr(signature, attr_name)
if inspect.ismethod(attribute):
assert attribute() == signature_attribute()
else:
assert attribute == signature_attribute
attribute = getattr(definition, attr_name)
signature_attribute = getattr(signature, attr_name)
if inspect.ismethod(attribute):
assert attribute() == signature_attribute()
else:
assert attribute == signature_attribute
def test_no_signature(Script):

View File

@@ -79,7 +79,7 @@ def test_killed_subprocess(evaluator, Script, environment):
if isinstance(environment, InterpreterEnvironment):
pytest.skip("We cannot kill our own process")
# Just kill the subprocess.
evaluator.compiled_subprocess._compiled_subprocess._process.kill()
evaluator.compiled_subprocess._compiled_subprocess._get_process().kill()
# Since the process was terminated (and nobody knows about it) the first
# Jedi call fails.
with pytest.raises(jedi.InternalError):