summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-08-12 17:51:35 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-08-12 17:51:35 (GMT)
commita7e33a10aebf0296535ecc705191e7ce0009d591 (patch)
treeb3ee7bcc2f4cf651e40988d8ed0d18ac27203b37 /PCbuild
parentf04488e2baea6bd539e90765eee98a0151e90574 (diff)
downloadcpython-a7e33a10aebf0296535ecc705191e7ce0009d591.zip
cpython-a7e33a10aebf0296535ecc705191e7ce0009d591.tar.gz
cpython-a7e33a10aebf0296535ecc705191e7ce0009d591.tar.bz2
Clean up test_shutil, to facilitate upcoming improvements (#12721).
The tests now have two convenience functions to wrap os.path.join, open and read or write instead of four or six slightly different functions. The new functions accept a tuple of path segments but not a list anymore, as it makes no sense to use a list here; I have also removed the default value for the contents in write_file, as I find it better to have the contents at the call site. For simple open then read/write calls, I have left the usual idiom (with open + read/write), as it is short and readable enough. I’ve also changed some convoluted cleanup code to just use rmtree, and removed dubious LBYL os.path.exists checks. The tests still pass on my machine, and leave no file in $TMP. test_shutil is not as clean as it could be, but I’ll stop here. Initial patch provided by Hynek Schlawack, in preparation for a new feature with new tests in #12715.
Diffstat (limited to 'PCbuild')
0 files changed, 0 insertions, 0 deletions