Gregory P. Smith wrote: > On Tue, Apr 1, 2008 at 9:13 AM, Tim Golden <mail at timgolden.me.uk> wrote: > >> Tim Golden wrote: >> <code> >> import os, sys >> import win32file >> >> FILENAME = "test" >> >> def rename_and_remove (filename): >> os.rename (filename, filename + ".deleted") >> os.remove (filename + ".deleted") > Isn't this still going to run into problems when the rename fails because > the earlier tests remove still left the .deleted file around due to some > other running desktop search service that now has the .deleted file open? I admit: this did occur to me on the train this am. While I try to think of a robust way to handle this, other people have proposed variations on pid-based / tempdir based filenames instead of the same name for each test. In principle this sounds good to me, but I'm not at all well-placed to assess the impact it might have on the unit tests in general. TJG
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4