1
0
forked from VimPlug/jedi

Get rid of deprecations in tests

This commit is contained in:
Dave Halter
2020-03-21 02:07:53 +01:00
parent 4c964ae655
commit d6d9286242
10 changed files with 40 additions and 27 deletions

View File

@@ -1,3 +1,17 @@
import warnings
import pytest
from jedi._compatibility import u
@pytest.fixture(autouse=True)
def check_for_warning(recwarn):
warnings.simplefilter("always")
with pytest.warns(DeprecationWarning):
yield
def test_goto_definitions(Script):
int_, = Script('x = 1\nx, y\ny', line=2, column=0).goto_definitions()
assert int_.name == 'int'
@@ -25,3 +39,9 @@ def test_usages(Script):
def test_call_signatures(Script):
d1, = Script('abs(float(\nstr(', line=1, column=4).call_signatures()
assert d1.name == 'abs'
def test_encoding_parameter(Script):
name = u('')
s = Script(name.encode('latin-1'), encoding='latin-1')
assert s._module_node.get_code() == name