123 > from __future__ import absolute_import |
123 > from __future__ import absolute_import |
124 > from testpackage import unsorted |
124 > from testpackage import unsorted |
125 > from mercurial.node import hex |
125 > from mercurial.node import hex |
126 > EOF |
126 > EOF |
127 |
127 |
128 $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py |
128 # Shadowing a stdlib module to test "relative import of stdlib module" is |
|
129 # allowed if the module is also being checked |
|
130 |
|
131 $ mkdir email |
|
132 $ touch email/__init__.py |
|
133 $ touch email/errors.py |
|
134 $ cat > email/utils.py << EOF |
|
135 > from __future__ import absolute_import |
|
136 > from . import errors |
|
137 > EOF |
|
138 |
|
139 $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py \ |
|
140 > email/*.py |
129 testpackage/importalias.py:2: ui module must be "as" aliased to uimod |
141 testpackage/importalias.py:2: ui module must be "as" aliased to uimod |
130 testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod |
142 testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod |
131 testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted |
143 testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted |
132 testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted |
144 testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted |
133 testpackage/importsymbolfromsub.py:2: direct symbol import nonmodule from testpackage.subpackage |
145 testpackage/importsymbolfromsub.py:2: direct symbol import nonmodule from testpackage.subpackage |