[Python-Dev] fixing tests on windows (original) (raw)
Tim Golden mail at timgolden.me.uk
Tue Apr 1 21:58:53 CEST 2008
- Previous message: [Python-Dev] fixing tests on windows
- Next message: [Python-Dev] fixing tests on windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Tim Golden wrote:
Giampaolo Rodola' wrote:
On 1 Apr, 18:27, "Steven Bethard" <steven.beth... at gmail.com> wrote:
On Tue, Apr 1, 2008 at 10:20 AM, Facundo Batista
<facundobati... at gmail.com> wrote: 2008/4/1, Tim Golden <m... at timgolden.me.uk>: > If this is the thing to do, presumably testsupport should > grow a "removefile" which does something of this sort? +1 (I was thinking exactly that). +1 here too. That looks like a great solution. Of course, once it's in testsupport, we need to fix all file removals in the test suite. ;-) Steve Why not just modifying testsupport.unlink() like this? Surely more convenient than modifying the whole suite. def unlink(filename): try: if os.name == 'nt': os.rename(filename, filename + ".deleted") filename = filename + ".deleted" os.unlink(filename) except OSError: pass Funnily enough, that's exactly what the patch I've put together does. Have to look out, though for anywhere which just calls os.unlink rather than going through testsupport.
Which turns out to be at least 117 instances:
C:\work-in-progress\python26\Lib\test>grep "os.unlink" *.py | wc -l 117
(including the patch I just posted for os.access. Oops). TJG
- Previous message: [Python-Dev] fixing tests on windows
- Next message: [Python-Dev] fixing tests on windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]