A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-April/078364.html below:

[Python-Dev] fixing tests on windows

[Python-Dev] fixing tests on windows [Python-Dev] fixing tests on windowsTim Golden mail at timgolden.me.uk
Wed Apr 2 10:03:51 CEST 2008
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
More information about the Python-Dev mailing list

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