def tearDown(self):
        sys.path[:] = self.syspath
        support.modules_cleanup(*self.modules_before)
        cleanout(self.root)

        # delete all modules concerning the tested hiearchy
        if self.pkgname:
            modules = [name for name in sys.modules
                       if self.pkgname in name.split('.')]
            for name in modules:
                del sys.modules[name]
Beispiel #2
0
    def tearDown(self):
        sys.path[:] = self.syspath
        support.modules_cleanup(*self.modules_before)
        if self.root:  # Only clean if the test was actually run
            cleanout(self.root)

        # delete all modules concerning the tested hierarchy
        if self.pkgname:
            modules = [name for name in sys.modules if self.pkgname in name.split(".")]
            for name in modules:
                del sys.modules[name]
Beispiel #3
0
 def tearDown(self):
     sys.path[:] = self.syspath
     support.modules_cleanup(*self.modules_before)
     if self.root:
         cleanout(self.root)
     if self.pkgname:
         modules = [
             name for name in sys.modules if self.pkgname in name.split('.')
         ]
         for name in modules:
             del sys.modules[name]
Beispiel #4
0
    def tearDown(self):
        sys.path[:] = self.syspath
        support.modules_cleanup(*self.modules_before)
        if self.root: # Only clean if the test was actually run
            cleanout(self.root)

        # delete all modules concerning the tested hierarchy
        if self.pkgname:
            modules = [name for name in sys.modules
                       if self.pkgname in name.split('.')]
            for name in modules:
                del sys.modules[name]
Beispiel #5
0
    def test_sundry(self):
        old_modules = support.modules_setup()
        try:
            for fn in os.listdir(scriptsdir):
                if not fn.endswith('.py'):
                    continue

                name = fn[:-3]
                if name in self.skiplist:
                    continue

                import_tool(name)
        finally:
            # Unload all modules loaded in this test
            support.modules_cleanup(*old_modules)
Beispiel #6
0
    def test_sundry(self):
        old_modules = support.modules_setup()
        try:
            for fn in os.listdir(scriptsdir):
                if not fn.endswith('.py'):
                    continue

                name = fn[:-3]
                if name in self.skiplist:
                    continue

                import_tool(name)
        finally:
            # Unload all modules loaded in this test
            support.modules_cleanup(*old_modules)
Beispiel #7
0
 def tearDown(self):
     sys.path[:] = self.path
     sys.meta_path[:] = self.meta_path
     sys.path_hooks[:] = self.path_hooks
     sys.path_importer_cache.clear()
     support.modules_cleanup(*self.modules_before)
Beispiel #8
0
 def tearDown(self):
     sys.path[:] = self.path
     sys.meta_path[:] = self.meta_path
     sys.path_hooks[:] = self.path_hooks
     sys.path_importer_cache.clear()
     support.modules_cleanup(*self.modules_before)