http://docs.python.org/3.3/library/shutil.html#shutil.rmtree can be used to achieve this. Also, this kind of thing should be done in a way where a failing test won't prevent the path from being removed.