tests/test-imports-checker.t
changeset 34038 bc2535238de2
parent 33262 8e6f4939a69a
child 39707 5abc47d4ca6b
--- a/tests/test-imports-checker.t	Thu Aug 31 11:28:59 2017 -0700
+++ b/tests/test-imports-checker.t	Mon Aug 28 13:43:25 2017 -0700
@@ -125,7 +125,19 @@
   > from mercurial.node import hex
   > EOF
 
-  $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py
+# Shadowing a stdlib module to test "relative import of stdlib module" is
+# allowed if the module is also being checked
+
+  $ mkdir email
+  $ touch email/__init__.py
+  $ touch email/errors.py
+  $ cat > email/utils.py << EOF
+  > from __future__ import absolute_import
+  > from . import errors
+  > EOF
+
+  $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py \
+  >   email/*.py
   testpackage/importalias.py:2: ui module must be "as" aliased to uimod
   testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod
   testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted