Only use absolute import
authorGuido Günther <agx@sigxcpu.org>
Thu, 19 Feb 2015 14:09:06 +0000 (15:09 +0100)
committerGuido Günther <agx@sigxcpu.org>
Fri, 20 Feb 2015 15:14:41 +0000 (16:14 +0100)
since searching both isn't supported in Python3. Since the tests are run
from the toplevel dir we'll pick up the right scripts.

tests/01_test_help.py

index 331d7cc603a120095d95f617f8dca25011cf807d..b0bb9a1353f78fb8618028a3d16ef036079550b7 100644 (file)
@@ -20,7 +20,7 @@ class TestHelp(unittest.TestCase):
                       'pull',
                       'pq']:
             module = 'gbp.scripts.%s' % script
-            m = __import__(module, globals(), locals(), ['main'], -1)
+            m = __import__(module, globals(), locals(), ['main'], 0)
             self.assertRaises(SystemExit,
                               m.main,
                               ['doesnotmatter', '--help'])
@@ -29,7 +29,7 @@ class TestHelp(unittest.TestCase):
     def testHelpRpm(self):
         for script in ['import_srpm']:
             module = 'gbp.scripts.%s' % script
-            m = __import__(module, globals(), locals(), ['main'], -1)
+            m = __import__(module, globals(), locals(), ['main'], 0)
             self.assertRaises(SystemExit,
                               m.main,
                               ['doesnotmatter', '--help'])