[issue14657] Avoid two importlib copies

Brett Cannon report at bugs.python.org
Thu May 17 17:25:51 CEST 2012


Brett Cannon <brett at python.org> added the comment:

Realized that any decorator or context manager that is created for swapping _frozen_importlib/importlib._bootstrap should also verify no module is left in sys.modules with a bad loader and that sys.path_importer_cache doesn't have a bad finder (I would say that this would go into test.support.regrtest's state checks, but that seems overkill for only two tests).

And this might be worth doing as a decorator (method or class) to make it easier to make sure the requisite tests always run with both versions (or copying what test_warnings does). I don't want to do anything in a module's test_main() as that precludes using unittest's test discovery for running tests.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14657>
_______________________________________


More information about the Python-bugs-list mailing list