@@ -0,0 +1,1506 @@
+from pychecker2.TestSupport import WarningTester%0Afrom pychecker2 import ImportChecks%0A%0Aclass ImportTestCase(WarningTester):%0A    def testImportChecks(self):%0A        self.silent('import sys; print sys.argv')%0A        self.silent('import pychecker2; print pychecker2')%0A        self.silent('import pychecker2.utest; print pychecker2.utest')%0A%0A    def testImportChecks(self):%0A        self.warning('import sys%5Cn'%0A                     'print sys.argv%5Cn'%0A                     'import sys%5Cn',%0A                     3, ImportChecks.ImportCheck.duplicateImport,%0A                     'sys', ' in current scope')%0A        self.warning('from sys import *%5Cn'%0A                     'def f():%5Cn'%0A                     '  def g():%5Cn'%0A                     '    from sys import argv%5Cn'%0A                     '    return argv%5Cn'%0A                     '  return g() + g()%5Cn'%0A                     'print argv%5Cn',%0A                     4, ImportChecks.ImportCheck.duplicateImport, 'argv',%0A                     ' of import in parent scope %3CModuleScope: global%3E')%0A        self.warning('import no_such_module%5Cn',%0A                     1, ImportChecks.ImportCheck.importError, 'no_such_module',%0A                     'No module named no_such_module')%0A        self.warning('from pychecker2.utest.data import *%5Cn'%0A                     'import exceptions%5Cn'%0A                     'print exceptions%5Cn',%0A                     2, ImportChecks.ImportCheck.shadowImport,%0A                     'exceptions', 'pychecker2.utest.data', 1)%0A                     %0A

test import checks