def test_import_name_binding(self):
# import x.y.z binds x in the current namespace.
import test as x
import test.test_support
self.assertIs(x, test, x.__name__)
self.assertTrue(hasattr(test.test_support, "__file__"))
# import x.y.z as w binds z as w.
import test.test_support as y
self.assertIs(y, test.test_support, y.__name__)
评论列表
文章目录