[Python-Dev] fixing tests on windows
mail at timgolden.me.uk
Wed Apr 9 15:04:57 CEST 2008
Trent Nelson wrote:
>> -----Original Message-----
>> From: Tim Golden [mailto:mail at timgolden.me.uk]
>> Sent: 04 April 2008 09:30
>> To: Trent Nelson
>> Cc: Python-Dev
>> Subject: Re: [Python-Dev] fixing tests on windows
>> Yes. I'm trying desperately hard to stick to a narrow remit
>> of getting tests to run consistently in the face of messy
>> file-locking semantics under Windows. I really don't want to
>> wade into the minor minefield of making all the tests run
>> with consistent temp file semantics. But I may have to.
> Hey Tim, any progress on this? I'd like to start working on this towards the weekend...
Thanks for the prod, Trent. In short, yes, I spent some time on
this over the weekend but haven't had time since. I found myself
becoming more and more worried at the amount I had to change,
especially given rumblings on the list concerning not changing
the tests if possible.
The possibilities I've been pursuing are these:
1) Leave TESTFN as-is and make the .unlink more robust
2) Leave TESTFN static but instead of "./@TEST" use the
tempfile module to generate a random name in whatever
temp dir applies for the test system. And make the .unlink
3) Drop TESTFN and have a function testfn () which generates
a new tempdir filename every time. And make the .unlink more
Each of these approaches has had its problems, and I'm additionally
hampered by the fact that I don't run *nix or OSX (or any other
platform). I spent far more time than I really had setting up
a VMWare player with Ubuntu but I haven't got it to the point
of building the tests which won't run under Windows.
Pros and cons:
1) Running with a fairly aggressive directory watcher, this doesn't
do enough to make the tests worth. Not worth it.
2) A bit better, especially since the betting is that most of the
suspect apps (local search engines etc.) won't index %TEMP%. But...
certain tests run into problems because they assume that the filename
of TESTFN has no escape-needy characters such as the backslash. Need
to update at least those tests.
3) [This is what I was trying over the weekend]. Loads of work and
quite intrusive. I'll try to get hold of my patch this evening and
mail it over to you. Part of the problem is working out where each
test is expecting TESTFN to be the same file each time and where
it doesn't care.
I was heartened to see that you'd gone ahead with the -- almost as
invasive -- socket test changes. If you'd like to take on what I've
got so far, or simply to adopt your own strategy, please feel free.
More information about the Python-Dev