def test_iter(self): modules = list(iterload('plugins')) self.assertEqual(len(modules), 2) self.assertTrue('plugins' in pool, pool) self.assertEqual(len(pool['plugins']), 2, pool) self.assertEqual(sorted(pool['plugins']), sorted(['everything', 'plugin']))
def _reset(replacer): modules = [] for module in iterload('searchreplace'): modules.append(module.__name__) for module in modules: del sys.modules[module] replacer._discovered = False replacer.models = {}