diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-24 13:44:19 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-24 13:44:19 +0100 |
commit | e321274b2eeaf9cfaccbc8d40c4056ab72040e1b (patch) | |
tree | d0ebaed68026c1a73a22a219f2424f347de1121e /Python/importlib.h | |
parent | ba8b0a7db447fad7a7064e53424725b02ab5ccec (diff) | |
download | cpython-git-e321274b2eeaf9cfaccbc8d40c4056ab72040e1b.tar.gz |
Enhance and modernize test_genericpath
* Replace "try/finally: os.remove()" with self.addCleanup(support.unlink) or
self.addCleanup(support.rmdir): the support function handles the case when
the file doesn't exist
* Replace "try/finally: f.close()" with "with open(...) as f:"
* test_getsize: add a second test with a different size
* Create file using "x" mode to ensure that the file didn't exist before, to
detect bugs in tests
* Open files in unbuffered mode (buferring=0) to write immediatly data on disk
* Replace map() with simpler code
* Split isdir() unit test into two units tests to make them less dependant,
same change for isfile() test
* test_samefile(): test also two different files
Diffstat (limited to 'Python/importlib.h')
0 files changed, 0 insertions, 0 deletions