This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients alexgarel, brett.cannon, chris.jerdonek, michael.foord, r.david.murray, rbcollins, slmnhq
Date 2012-06-04.15:20:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Because we don't know if the rest of the test code will adhere to this, we might want to consider clearing the cache before each test as well.

Alternatively, we could avoid having to call importlib.invalidate_caches() at all (and having to think about for which tests it is necessary) if we do each test in a different directory and with a different name for the test package.  We could do the former as follows:

    with support.temp_cwd(support.TESTFN):
        dir_name ='.')[-1]  # test method name
        with support.temp_cwd(dir_name) as cwd:
            with support.DirsOnSysPath(cwd):
                # Create package and run test.

An approach like this might be less prone to issues that are hard to troubleshoot.  I verified that it works.
Date User Action Args
2012-06-04 15:20:39chris.jerdoneksetrecipients: + chris.jerdonek, brett.cannon, rbcollins, r.david.murray, michael.foord, slmnhq, alexgarel
2012-06-04 15:20:38chris.jerdoneksetmessageid: <>
2012-06-04 15:20:38chris.jerdoneklinkissue7559 messages
2012-06-04 15:20:37chris.jerdonekcreate