Commit 0ef20052 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Add some package-importing and relative-importing tests

parent 32254d13
......@@ -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
......
......@@ -919,7 +919,7 @@ AST_Module* parse(const char* fn) {
return ast_cast<AST_Module>(rtn);
}
#define MAGIC_STRING "a\nci"
#define MAGIC_STRING "a\ncj"
#define MAGIC_STRING_LENGTH 4
#define CHECKSUM_LENGTH 4
......
# expected: fail
# - Relative imports not supported
try:
from . import doesnt_exist
except ImportError, e:
print e
# 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
import import_target
print import_target
from __future__ import absolute_import
import import_target
print import_target
print "running test_package.import_target"
from . import import_target
print import_target
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment