tests/test-imports-checker.t
changeset 39707 5abc47d4ca6b
parent 34038 bc2535238de2
child 43954 303576116ac1
equal deleted inserted replaced
39706:030d558c6456 39707:5abc47d4ca6b
     6 
     6 
     7 Run the doctests from the import checker, and make sure
     7 Run the doctests from the import checker, and make sure
     8 it's working correctly.
     8 it's working correctly.
     9   $ TERM=dumb
     9   $ TERM=dumb
    10   $ export TERM
    10   $ export TERM
    11   $ $PYTHON -m doctest $import_checker
    11   $ "$PYTHON" -m doctest $import_checker
    12 
    12 
    13 Run additional tests for the import checker
    13 Run additional tests for the import checker
    14 
    14 
    15   $ mkdir testpackage
    15   $ mkdir testpackage
    16   $ touch testpackage/__init__.py
    16   $ touch testpackage/__init__.py
   134   $ cat > email/utils.py << EOF
   134   $ cat > email/utils.py << EOF
   135   > from __future__ import absolute_import
   135   > from __future__ import absolute_import
   136   > from . import errors
   136   > from . import errors
   137   > EOF
   137   > EOF
   138 
   138 
   139   $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py \
   139   $ "$PYTHON" "$import_checker" testpackage*/*.py testpackage/subpackage/*.py \
   140   >   email/*.py
   140   >   email/*.py
   141   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
   142   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
   143   testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted
   143   testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted
   144   testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted
   144   testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted