tests/test-imports-checker.t
changeset 34055 bc2535238de2
parent 33262 8e6f4939a69a
child 39723 5abc47d4ca6b
equal deleted inserted replaced
34054:65ae54582713 34055:bc2535238de2
   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