forked from VimPlug/jedi
Remove a few unicode references in tests
This commit is contained in:
@@ -9,7 +9,6 @@ import pytest
|
|||||||
from pytest import raises
|
from pytest import raises
|
||||||
from parso import cache
|
from parso import cache
|
||||||
|
|
||||||
from jedi._compatibility import unicode
|
|
||||||
from jedi import preload_module
|
from jedi import preload_module
|
||||||
from jedi.inference.gradual import typeshed
|
from jedi.inference.gradual import typeshed
|
||||||
from test.helpers import test_dir, get_example_dir
|
from test.helpers import test_dir, get_example_dir
|
||||||
@@ -326,7 +325,7 @@ def test_goto_follow_builtin_imports(Script):
|
|||||||
|
|
||||||
def test_docstrings_for_completions(Script):
|
def test_docstrings_for_completions(Script):
|
||||||
for c in Script('').complete():
|
for c in Script('').complete():
|
||||||
assert isinstance(c.docstring(), (str, unicode))
|
assert isinstance(c.docstring(), str)
|
||||||
|
|
||||||
|
|
||||||
def test_fuzzy_completion(Script):
|
def test_fuzzy_completion(Script):
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ def test_goto_keyword(Script):
|
|||||||
"""
|
"""
|
||||||
Bug: goto assignments on ``in`` used to raise AttributeError::
|
Bug: goto assignments on ``in`` used to raise AttributeError::
|
||||||
|
|
||||||
'unicode' object has no attribute 'generate_call_path'
|
'str' object has no attribute 'generate_call_path'
|
||||||
"""
|
"""
|
||||||
Script('in').goto()
|
Script('in').goto()
|
||||||
|
|
||||||
|
|||||||
@@ -37,18 +37,14 @@ def test_unicode_attribute(Script):
|
|||||||
|
|
||||||
def test_multibyte_script(Script):
|
def test_multibyte_script(Script):
|
||||||
""" `jedi.Script` must accept multi-byte string source. """
|
""" `jedi.Script` must accept multi-byte string source. """
|
||||||
try:
|
|
||||||
code = u("import datetime; datetime.d")
|
code = u("import datetime; datetime.d")
|
||||||
comment = u("# multi-byte comment あいうえおä")
|
comment = u("# multi-byte comment あいうえおä")
|
||||||
s = (u('%s\n%s') % (code, comment)).encode('utf-8')
|
s = (u('%s\n%s') % (code, comment))
|
||||||
except NameError:
|
|
||||||
pass # python 3 has no unicode method
|
|
||||||
else:
|
|
||||||
assert len(Script(s).complete(1, len(code)))
|
assert len(Script(s).complete(1, len(code)))
|
||||||
|
|
||||||
|
|
||||||
def test_goto_definition_at_zero(Script):
|
def test_goto_definition_at_zero(Script):
|
||||||
"""At zero usually sometimes raises unicode issues."""
|
"""Infer at zero sometimes raises issues."""
|
||||||
assert Script("a").infer(1, 1) == []
|
assert Script("a").infer(1, 1) == []
|
||||||
s = Script("str").infer(1, 1)
|
s = Script("str").infer(1, 1)
|
||||||
assert len(s) == 1
|
assert len(s) == 1
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def test_goto_assignment(Script, source, solution):
|
|||||||
def test_simple_completions(Script):
|
def test_simple_completions(Script):
|
||||||
# completion
|
# completion
|
||||||
completions = script_with_path(Script, 'from pkg import ').complete()
|
completions = script_with_path(Script, 'from pkg import ').complete()
|
||||||
names = [str(c.name) for c in completions] # str because of unicode
|
names = [c.name for c in completions]
|
||||||
compare = ['foo', 'ns1_file', 'ns1_folder', 'ns2_folder', 'ns2_file',
|
compare = ['foo', 'ns1_file', 'ns1_folder', 'ns2_folder', 'ns2_file',
|
||||||
'pkg_resources', 'pkgutil', '__name__', '__path__',
|
'pkg_resources', 'pkgutil', '__name__', '__path__',
|
||||||
'__package__', '__file__', '__doc__']
|
'__package__', '__file__', '__doc__']
|
||||||
|
|||||||
Reference in New Issue
Block a user