mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Use Parser.module instead of Parser.scope
This commit is contained in:
@@ -8,7 +8,7 @@ def test_explicit_absolute_imports():
|
|||||||
Detect modules with ``from __future__ import absolute_import``.
|
Detect modules with ``from __future__ import absolute_import``.
|
||||||
"""
|
"""
|
||||||
parser = Parser("from __future__ import absolute_import", "test.py")
|
parser = Parser("from __future__ import absolute_import", "test.py")
|
||||||
assert parser.scope.explicit_absolute_import
|
assert parser.module.explicit_absolute_import
|
||||||
|
|
||||||
|
|
||||||
def test_no_explicit_absolute_imports():
|
def test_no_explicit_absolute_imports():
|
||||||
@@ -16,7 +16,7 @@ def test_no_explicit_absolute_imports():
|
|||||||
Detect modules without ``from __future__ import absolute_import``.
|
Detect modules without ``from __future__ import absolute_import``.
|
||||||
"""
|
"""
|
||||||
parser = Parser("1", "test.py")
|
parser = Parser("1", "test.py")
|
||||||
assert not parser.scope.explicit_absolute_import
|
assert not parser.module.explicit_absolute_import
|
||||||
|
|
||||||
|
|
||||||
def test_dont_break_imports_without_namespaces():
|
def test_dont_break_imports_without_namespaces():
|
||||||
@@ -26,7 +26,7 @@ def test_dont_break_imports_without_namespaces():
|
|||||||
"""
|
"""
|
||||||
src = "from __future__ import absolute_import\nimport xyzzy"
|
src = "from __future__ import absolute_import\nimport xyzzy"
|
||||||
parser = Parser(src, "test.py")
|
parser = Parser(src, "test.py")
|
||||||
assert parser.scope.explicit_absolute_import
|
assert parser.module.explicit_absolute_import
|
||||||
|
|
||||||
|
|
||||||
@base.cwd_at("test/absolute_import")
|
@base.cwd_at("test/absolute_import")
|
||||||
|
|||||||
Reference in New Issue
Block a user