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 brett.cannon
Recipients Arfrever, brett.cannon, eli.bendersky, eric.snow, ezio.melotti, pitrou
Date 2013-01-27.23:59:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359331194.09.0.490530692775.issue17037@psf.upfronthosting.co.za>
In-reply-to
Content
To prevent speculation, the files that mention import_fresh_module are:

# Without changes to test classes
Lib/test/test_bisect.py: would work if you made the attribute configurable (e.g. self.module instead of self.bisect
Lib/test/test_heapq.py: would work
Lib/test/test_warnings.py: would work if you made the attribute configurable

# With minor changes to test classes
Lib/test/json_tests/__init__.py: would work if you took out the function accessing shortcuts (e.g. self.json.loads instead of self.loads)
Lib/test/test_functools.py: would work if you took out the function accessing shortcuts

# Won't work
Lib/test/test_datetime.py: has its own crazy version of this approach (although it sounds like part of it is because of problem with import_fresh_module and other things that might need to be fixed)
Lib/test/test_decimal.py: won't work because of fractions modules
Lib/test/test_xml_etree.py: doctest-based
Lib/test/test_xml_etree_c.py: specific to accelerated version

# Doesn't apply
Lib/test/support.py: because it defines it =) 
Lib/test/test_bz2.py: used in a single test method
Lib/test/test_importlib/test_api.py: used in a single test
Lib/test/test_support.py: obvious =)


So out of 9 test modules it will work with 5 of them (2 with either search-and-replace changes to the test code or making the proposed solution more flexible) and not w/ 4 (or 3 if you don't count the etree tests as separate, and the test_datetime seems weird as to why it's so complicated based on the comments in the code). So overall it still seems like a win to me, especially if we keep adding more test modules that need this approach.
History
Date User Action Args
2013-01-27 23:59:54brett.cannonsetrecipients: + brett.cannon, pitrou, ezio.melotti, Arfrever, eli.bendersky, eric.snow
2013-01-27 23:59:54brett.cannonsetmessageid: <1359331194.09.0.490530692775.issue17037@psf.upfronthosting.co.za>
2013-01-27 23:59:54brett.cannonlinkissue17037 messages
2013-01-27 23:59:53brett.cannoncreate