mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Remove the __builtin__ compatibility
This commit is contained in:
@@ -142,8 +142,6 @@ def test_parent_context(same_process_inference_state, attribute, expected_name,
|
||||
x, = o.py__getattribute__(attribute)
|
||||
assert x.py__name__() == expected_name
|
||||
module_name = x.parent_context.py__name__()
|
||||
if module_name == '__builtin__':
|
||||
module_name = 'builtins' # Python 2
|
||||
assert module_name == expected_parent
|
||||
assert x.parent_context.parent_context is None
|
||||
|
||||
|
||||
@@ -432,9 +432,6 @@ def test_import_name_calculation(Script):
|
||||
|
||||
@pytest.mark.parametrize('name', ('builtins', 'typing'))
|
||||
def test_pre_defined_imports_module(Script, environment, name):
|
||||
if environment.version_info.major < 3 and name == 'builtins':
|
||||
name = '__builtin__'
|
||||
|
||||
path = os.path.join(root_dir, name + '.py')
|
||||
module = Script('', path=path)._get_module_context()
|
||||
assert module.string_names == (name,)
|
||||
@@ -445,9 +442,6 @@ def test_pre_defined_imports_module(Script, environment, name):
|
||||
|
||||
@pytest.mark.parametrize('name', ('builtins', 'typing'))
|
||||
def test_import_needed_modules_by_jedi(Script, environment, tmpdir, name):
|
||||
if environment.version_info.major < 3 and name == 'builtins':
|
||||
name = '__builtin__'
|
||||
|
||||
module_path = tmpdir.join(name + '.py')
|
||||
module_path.write('int = ...')
|
||||
script = Script(
|
||||
|
||||
Reference in New Issue
Block a user