mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-31 01:05:22 +08:00
Remove unicode literals from code base
This commit is contained in:
@@ -43,7 +43,7 @@ def test_versions(version):
|
||||
|
||||
def test_load_module(inference_state):
|
||||
access_path = inference_state.compiled_subprocess.load_module(
|
||||
dotted_name=u'math',
|
||||
dotted_name='math',
|
||||
sys_path=inference_state.get_sys_path()
|
||||
)
|
||||
name, access_handle = access_path.accesses[0]
|
||||
|
||||
@@ -564,7 +564,7 @@ def test_param_annotation_completion(class_is_findable):
|
||||
]
|
||||
)
|
||||
def test_dict_completion(code, column, expected):
|
||||
strs = {'asdf': 1, u"""foo""": 2, r'fbar': 3}
|
||||
strs = {'asdf': 1, """foo""": 2, r'fbar': 3}
|
||||
mixed = {1: 2, 1.10: 4, None: 6, r'a\sdf': 8, b'foo': 9}
|
||||
|
||||
namespaces = [locals(), {'implicit': {1000: 3}}]
|
||||
|
||||
@@ -12,22 +12,22 @@ from jedi.inference.syntax_tree import _infer_comparison_part
|
||||
|
||||
|
||||
def test_simple(inference_state, environment):
|
||||
obj = compiled.create_simple_object(inference_state, u'_str_')
|
||||
upper, = obj.py__getattribute__(u'upper')
|
||||
obj = compiled.create_simple_object(inference_state, '_str_')
|
||||
upper, = obj.py__getattribute__('upper')
|
||||
objs = list(upper.execute_with_values())
|
||||
assert len(objs) == 1
|
||||
assert objs[0].name.string_name == 'str'
|
||||
|
||||
|
||||
def test_builtin_loading(inference_state):
|
||||
string, = inference_state.builtins_module.py__getattribute__(u'str')
|
||||
from_name, = string.py__getattribute__(u'__init__')
|
||||
string, = inference_state.builtins_module.py__getattribute__('str')
|
||||
from_name, = string.py__getattribute__('__init__')
|
||||
assert from_name.tree_node
|
||||
assert not from_name.py__doc__() # It's a stub
|
||||
|
||||
|
||||
def test_next_docstr(inference_state):
|
||||
next_ = compiled.builtin_from_name(inference_state, u'next')
|
||||
next_ = compiled.builtin_from_name(inference_state, 'next')
|
||||
assert next_.tree_node is not None
|
||||
assert next_.py__doc__() == '' # It's a stub
|
||||
for non_stub in _stub_to_python_value_set(next_):
|
||||
@@ -48,9 +48,9 @@ def test_doc(inference_state):
|
||||
Even CompiledValue docs always return empty docstrings - not None, that's
|
||||
just a Jedi API definition.
|
||||
"""
|
||||
str_ = compiled.create_simple_object(inference_state, u'')
|
||||
str_ = compiled.create_simple_object(inference_state, '')
|
||||
# Equals `''.__getnewargs__`
|
||||
obj, = str_.py__getattribute__(u'__getnewargs__')
|
||||
obj, = str_.py__getattribute__('__getnewargs__')
|
||||
assert obj.py__doc__() == ''
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ def test_operation(Script, inference_state, create_compiled_object):
|
||||
false, true = _infer_comparison_part(
|
||||
inference_state, b.parent_context,
|
||||
left=list(b.execute_with_values())[0],
|
||||
operator=u'is not',
|
||||
operator='is not',
|
||||
right=b,
|
||||
)
|
||||
assert false.py__name__() == 'bool'
|
||||
|
||||
@@ -50,8 +50,8 @@ def test_find_module_package_zipped(Script, inference_state, environment):
|
||||
|
||||
file_io, is_package = inference_state.compiled_subprocess.get_module_info(
|
||||
sys_path=sys_path,
|
||||
string=u'pkg',
|
||||
full_name=u'pkg'
|
||||
string='pkg',
|
||||
full_name='pkg'
|
||||
)
|
||||
assert file_io is not None
|
||||
assert file_io.path.endswith(os.path.join('pkg.zip', 'pkg', '__init__.py'))
|
||||
@@ -104,8 +104,8 @@ def test_find_module_not_package_zipped(Script, inference_state, environment):
|
||||
|
||||
file_io, is_package = inference_state.compiled_subprocess.get_module_info(
|
||||
sys_path=sys_path,
|
||||
string=u'not_pkg',
|
||||
full_name=u'not_pkg'
|
||||
string='not_pkg',
|
||||
full_name='not_pkg'
|
||||
)
|
||||
assert file_io.path.endswith(os.path.join('not_pkg.zip', 'not_pkg.py'))
|
||||
assert is_package is False
|
||||
|
||||
Reference in New Issue
Block a user