• Éric Araujo's avatar
    Clean up test_shutil, to facilitate upcoming improvements (#12721). · a7e33a10
    Éric Araujo yazdı
    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.
    a7e33a10
Adı
Son kayıt (commit)
Son güncelleme
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.bzrignore Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...