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 ncoghlan
Recipients Arfrever, alexis, brett.cannon, eric.araujo, ncoghlan, tarek
Date 2012-04-26.01:38:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1335404296.96.0.734120398339.issue13473@psf.upfronthosting.co.za>
In-reply-to
Content
Your basic approach looks sensible to me.

One trick I use in test_cmd_line_script to prevent recreation is to simply delete the source file. If the source is gone, implicit recreation is impossible. Unfortunately, that doesn't work for __pycache__, since the cached version will be ignored if the original goes missing.

One useful explicit check (as per #14443) would be to ensure the magic number and other attributes are as expected:
http://hg.python.org/cpython/file/57d558f1904d/Lib/importlib/_bootstrap.py#l444

You can also pass the "-B" flag to your testing subprocesses, which will switch off the implicit bytecode generation.
History
Date User Action Args
2012-04-26 01:38:17ncoghlansetrecipients: + ncoghlan, brett.cannon, tarek, eric.araujo, Arfrever, alexis
2012-04-26 01:38:16ncoghlansetmessageid: <1335404296.96.0.734120398339.issue13473@psf.upfronthosting.co.za>
2012-04-26 01:38:16ncoghlanlinkissue13473 messages
2012-04-26 01:38:16ncoghlancreate