Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
0ef20052
Commit
0ef20052
authored
Oct 27, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some package-importing and relative-importing tests
parent
32254d13
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
2 deletions
+30
-2
src/codegen/parse_ast.py
src/codegen/parse_ast.py
+1
-1
src/codegen/parser.cpp
src/codegen/parser.cpp
+1
-1
test/tests/package_import_in_nonpackage.py
test/tests/package_import_in_nonpackage.py
+7
-0
test/tests/package_test.py
test/tests/package_test.py
+11
-0
test/tests/test_package/__init__.py
test/tests/test_package/__init__.py
+0
-0
test/tests/test_package/absolute_import.py
test/tests/test_package/absolute_import.py
+3
-0
test/tests/test_package/absolute_import_with_future.py
test/tests/test_package/absolute_import_with_future.py
+4
-0
test/tests/test_package/import_target.py
test/tests/test_package/import_target.py
+1
-0
test/tests/test_package/intrapackage_import.py
test/tests/test_package/intrapackage_import.py
+2
-0
No files found.
src/codegen/parse_ast.py
View file @
0ef20052
...
...
@@ -135,7 +135,7 @@ def convert(n, f):
if
k
.
startswith
(
'_'
):
continue
if
k
in
(
"vararg"
,
"kwarg"
,
"asname"
)
and
v
is
None
:
if
k
in
(
"vararg"
,
"kwarg"
,
"asname"
,
"module"
)
and
v
is
None
:
v
=
""
# elif k in ('col_offset', 'lineno'):
# continue
...
...
src/codegen/parser.cpp
View file @
0ef20052
...
...
@@ -919,7 +919,7 @@ AST_Module* parse(const char* fn) {
return
ast_cast
<
AST_Module
>
(
rtn
);
}
#define MAGIC_STRING "a\nc
i
"
#define MAGIC_STRING "a\nc
j
"
#define MAGIC_STRING_LENGTH 4
#define CHECKSUM_LENGTH 4
...
...
test/tests/package_import_in_nonpackage.py
0 → 100644
View file @
0ef20052
# expected: fail
# - Relative imports not supported
try
:
from
.
import
doesnt_exist
except
ImportError
,
e
:
print
e
test/tests/package_test.py
0 → 100644
View file @
0ef20052
# expected: fail
# - packages not supported
# - intra-package imports ("from . import foo") not supported
# - "from __future__ import absolute_import" not supported
import
test_package
print
test_package
import
test_package.intrapackage_import
import
test_package.absolute_import
import
test_package.absolute_import_with_future
test/tests/test_package/__init__.py
0 → 100644
View file @
0ef20052
test/tests/test_package/absolute_import.py
0 → 100644
View file @
0ef20052
import
import_target
print
import_target
test/tests/test_package/absolute_import_with_future.py
0 → 100644
View file @
0ef20052
from
__future__
import
absolute_import
import
import_target
print
import_target
test/tests/test_package/import_target.py
0 → 100644
View file @
0ef20052
print
"running test_package.import_target"
test/tests/test_package/intrapackage_import.py
0 → 100644
View file @
0ef20052
from
.
import
import_target
print
import_target
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment