[Python-Dev] Unit Test Guide

Christian Heimes lists at cheimes.de
Thu Feb 21 18:14:37 CET 2008


Guido van Rossum wrote:
>>  I don't think so.
>>  You could create a directory in setUp method by using tempfile.mkdtemp
>>  and then remove it in tearDown.
> 
> Specifically, clean it up with shutil.rmtree()

And make sure you have closed all files before you rmtree() the
directory. Otherwise the unit test *will* fail on Windows.

Christian



More information about the Python-Dev mailing list