]> granicus.if.org Git - python/commit
Enhance and modernize test_os
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 24 Mar 2016 16:12:55 +0000 (17:12 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 24 Mar 2016 16:12:55 +0000 (17:12 +0100)
commitae39d236b41ad369215dc523b63000f4860517cc
treed9268f826542e2f2ec7ddb4cb02afc9f69ce65f4
parentf95a19b900262c32d1038a6ab9a6808a58656c34
Enhance and modernize test_os

* add create_file() helper function
* create files using "x" mode instead of "w" to detect when a previous test
  forget to remove a file
* open file for writing in unbuferred mode (buffering=0)
* replace "try/finally: unlink" with self.addCleanup(support.unlink)
* register unlink cleanup function *before* creating new files
Lib/test/test_os.py