class ImportHooksLookupTests(unittest.TestCase, LookupsTestCase): """ Tests for lookup methods in the presence of L{ihooks}-style import hooks. Runs all of the tests from L{LookupsTestCase} after installing a custom import hook. """ skip = ("ihooks support is broken, and has probably been broken since " "Python 2.6. On the other hand, no one should use ihooks.") def setUp(self): """ Perturb the normal import behavior subtly by installing an import hook. No custom behavior is provided, but this adds some extra frames to the call stack, which L{namedAny} must be able to account for. """ self.importer = ModuleImporter() self.importer.install() def tearDown(self): """ Uninstall the custom import hook. """ self.importer.uninstall()
class ImportHooksLookupTests(LookupsTestCase): """ Tests for lookup methods in the presence of L{ihooks}-style import hooks. Runs all of the tests from L{LookupsTestCase} after installing a custom import hook. """ if ModuleImporter == None: skip = "ihooks not available" def setUp(self): """ Perturb the normal import behavior subtly by installing an import hook. No custom behavior is provided, but this adds some extra frames to the call stack, which L{namedAny} must be able to account for. """ self.importer = ModuleImporter() self.importer.install() def tearDown(self): """ Uninstall the custom import hook. """ self.importer.uninstall()