-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75ce150
commit fdf5a45
Showing
16 changed files
with
198 additions
and
14 deletions.
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
...ages/tree-sitter-stack-graphs-python/test/bugs.skip/relative_import_resolves_to_itself.py
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
languages/tree-sitter-stack-graphs-python/test/imports/import_from_module_a_submodule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# --- path: foo/bar.py --- | ||
|
||
BAR = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
from foo import bar | ||
|
||
bar.BAR | ||
# ^ defined: 7, 3 | ||
# ^ defined: 3 | ||
|
||
foo | ||
# ^ defined: |
13 changes: 13 additions & 0 deletions
13
languages/tree-sitter-stack-graphs-python/test/imports/import_from_module_a_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# --- path: foo.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
from foo import FOO | ||
|
||
FOO | ||
# ^ defined: 7, 3 | ||
|
||
foo | ||
# ^ defined: |
13 changes: 13 additions & 0 deletions
13
languages/tree-sitter-stack-graphs-python/test/imports/import_from_module_a_value_aliased.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# --- path: foo.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
from foo import FOO as QUX | ||
|
||
QUX | ||
# ^ defined: 7, 3 | ||
|
||
FOO | ||
# ^ defined: |
13 changes: 13 additions & 0 deletions
13
languages/tree-sitter-stack-graphs-python/test/imports/import_from_module_wildcard.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# --- path: foo.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
from foo import * | ||
|
||
FOO | ||
# ^ defined: 3 | ||
|
||
foo | ||
# ^ defined: |
16 changes: 16 additions & 0 deletions
16
languages/tree-sitter-stack-graphs-python/test/imports/import_from_submodule_a_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# --- path: foo/bar.py --- | ||
|
||
BAR = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
from foo.bar import BAR | ||
|
||
BAR | ||
# ^ defined: 7, 3 | ||
|
||
foo | ||
# ^ defined: | ||
|
||
bar | ||
# ^ defined: |
10 changes: 10 additions & 0 deletions
10
languages/tree-sitter-stack-graphs-python/test/imports/import_from_super_package_a_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# --- path: foo/__init__.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: foo/bar/test.py --- | ||
|
||
from .. import FOO | ||
|
||
FOO | ||
# ^ defined: 7, 3 |
10 changes: 10 additions & 0 deletions
10
...ee-sitter-stack-graphs-python/test/imports/import_from_super_package_submodule_a_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# --- path: foo/bar.py --- | ||
|
||
BAR = 42 | ||
|
||
# --- path: foo/baz/test.py --- | ||
|
||
from ..bar import BAR | ||
|
||
BAR | ||
# ^ defined: 7, 3 |
10 changes: 10 additions & 0 deletions
10
languages/tree-sitter-stack-graphs-python/test/imports/import_from_this_package_a_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# --- path: foo/__init__.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: foo/test.py --- | ||
|
||
from . import FOO | ||
|
||
FOO | ||
# ^ defined: 7, 3 |
10 changes: 10 additions & 0 deletions
10
...ree-sitter-stack-graphs-python/test/imports/import_from_this_package_submodule_a_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# --- path: foo/bar.py --- | ||
|
||
BAR = 42 | ||
|
||
# --- path: foo/test.py --- | ||
|
||
from .bar import BAR | ||
|
||
BAR | ||
# ^ defined: 7, 3 |
11 changes: 11 additions & 0 deletions
11
languages/tree-sitter-stack-graphs-python/test/imports/import_module.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# --- path: foo.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
import foo | ||
|
||
foo.FOO | ||
# ^ defined: 7, 3 | ||
# ^ defined: 3 |
14 changes: 14 additions & 0 deletions
14
languages/tree-sitter-stack-graphs-python/test/imports/import_module_aliased.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# --- path: foo.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
import foo as qux | ||
|
||
qux.FOO | ||
# ^ defined: 7, 3 | ||
# ^ defined: 3 | ||
|
||
foo | ||
# ^ defined: |
15 changes: 15 additions & 0 deletions
15
languages/tree-sitter-stack-graphs-python/test/imports/import_submodule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# --- path: foo/bar.py --- | ||
|
||
BAR = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
import foo.bar | ||
|
||
foo.bar.BAR | ||
# ^ defined: 7 | ||
# ^ defined: 7, 3 | ||
# ^ defined: 3 | ||
|
||
bar | ||
# ^ defined: |
17 changes: 17 additions & 0 deletions
17
languages/tree-sitter-stack-graphs-python/test/imports/import_submodule_aliased.py.skip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# --- path: foo/bar.py --- | ||
|
||
BAR = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
import foo.bar as qux | ||
|
||
qux.BAR | ||
# ^ defined: 7 | ||
# ^ defined: 3 | ||
|
||
foo | ||
# ^ defined: | ||
|
||
bar | ||
# ^ defined: |
14 changes: 14 additions & 0 deletions
14
...s/tree-sitter-stack-graphs-python/test/imports/relative_import_resolves_to_itself.py.skip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# --- path: foo/__init__.py --- | ||
from . import bar | ||
# ^ defined: 6 | ||
|
||
# --- path: foo/bar/__init__.py --- | ||
BAR = 'b' | ||
|
||
# --- path: main.py --- | ||
from foo import bar | ||
# ^ defined: 6 | ||
|
||
bar.BAR | ||
# ^ defined: 9, 6 | ||
# ^ defined: 6 |
18 changes: 18 additions & 0 deletions
18
...es/tree-sitter-stack-graphs-python/test/imports/require_explicit_submodule_import.py.skip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# --- path: foo/__init__.py --- | ||
|
||
FOO = 42 | ||
|
||
# --- path: foo/bar.py --- | ||
|
||
BAR = 42 | ||
|
||
# --- path: test.py --- | ||
|
||
import foo | ||
|
||
foo.FOO | ||
# ^ defined: 11, 3 | ||
# ^ defined: 3 | ||
|
||
foo.bar | ||
# ^ defined: |