test_file fails, hard-coded tmp dir to blame?
Hello, test_file fails at this end. It seems that it tries to create a '/tmp/tt' file, but it fails. This is so because my temp directory is at '/windows/temp' not '/tmp'. If I correctly understand this problem, then find attached a fix that got the test to pass. Hope that helps. Regards, Khalid PS. In case the developers here are interested to know, all the tests pass now on this box, including the JAVA and LISP ones which are made to use Jikes (version 1.20) and GNU CLISP (version 2.33) on Win98, MinGW built Python 2.3.5.0 (from CVS), and GCC 3.4.2 (MinGW special). Index: pypy/appspace/test/test_file.py =================================================================== --- pypy/appspace/test/test_file.py (revision 8317) +++ pypy/appspace/test/test_file.py (working copy) @@ -16,8 +16,10 @@ assert self.fd.tell() == 0 def test_case_readonly(self): - f=_file.file_('/tmp/tt', 'w') - assert f.name == '/tmp/tt' + from tempfile import mktemp + fn = mktemp() + f=_file.file_(fn, 'w') + assert f.name == fn assert f.mode == 'w' assert f.closed == False assert f.encoding == None # Fix when we find out what this is _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Hi Khalid, On Mon, Jan 17, 2005 at 02:29 +0000, A.B., Khalid wrote:
test_file fails at this end. It seems that it tries to create a '/tmp/tt' file, but it fails. This is so because my temp directory is at '/windows/temp' not '/tmp'.
Yes, this hardcoded temp path is wrong.
If I correctly understand this problem, then find attached a fix that got the test to pass. Hope that helps.
It fixes the problem but it will create more and more temporary directories. In PyPy, we have a "pypy.tool.udir.udir" which gets globally created for every test run. Older test session directories will get removed so we don't clutter temp-directories so much .... i just fixed it accordingly.
PS. In case the developers here are interested to know, all the tests pass now on this box, including the JAVA and LISP ones which are made to use Jikes (version 1.20) and GNU CLISP (version 2.33) on Win98, MinGW built Python 2.3.5.0 (from CVS), and GCC 3.4.2 (MinGW special).
Ah, that sounds good! Yesterday i spent some time to get the tests to fail more nicely if java/lisp/C cannot be found. So we have covered both ends :-) cheers, holger
participants (2)
-
A.B., Khalid -
hpk@trillke.net