From: <pj...@us...> - 2009-05-26 06:49:59
|
Revision: 6380 http://jython.svn.sourceforge.net/jython/?rev=6380&view=rev Author: pjenvey Date: 2009-05-26 06:49:37 +0000 (Tue, 26 May 2009) Log Message: ----------- add windows skips, close files in test_traceback Modified Paths: -------------- trunk/jython/Lib/test/regrtest.py trunk/jython/Lib/test/test_dircache.py trunk/jython/Lib/test/test_signal.py trunk/jython/Lib/test/test_traceback.py Modified: trunk/jython/Lib/test/regrtest.py =================================================================== --- trunk/jython/Lib/test/regrtest.py 2009-05-26 06:40:28 UTC (rev 6379) +++ trunk/jython/Lib/test/regrtest.py 2009-05-26 06:49:37 UTC (rev 6380) @@ -1532,9 +1532,7 @@ if test_support.is_jython: if os._name != 'posix': - self.expected.add('test_mhlib') - import platform - os_name = platform.java_ver()[3][0] + self.expected.update(['test_mhlib', 'test_signal']) self.valid = True Modified: trunk/jython/Lib/test/test_dircache.py =================================================================== --- trunk/jython/Lib/test/test_dircache.py 2009-05-26 06:40:28 UTC (rev 6379) +++ trunk/jython/Lib/test/test_dircache.py 2009-05-26 06:49:37 UTC (rev 6380) @@ -4,7 +4,7 @@ """ import unittest -from test.test_support import run_unittest, TESTFN +from test.test_support import is_jython, run_unittest, TESTFN import dircache, os, time, sys, tempfile @@ -44,7 +44,8 @@ # That is, this test can't possibly work under Windows -- dircache # is only good for capturing a one-shot snapshot there. - if sys.platform[:3] not in ('win', 'os2'): + if (sys.platform[:3] not in ('win', 'os2') or + (is_jython and os._name != 'nt')): # Sadly, dircache has the same granularity as stat.mtime, and so # can't notice any changes that occurred within 1 sec of the last # time it examined a directory. Modified: trunk/jython/Lib/test/test_signal.py =================================================================== --- trunk/jython/Lib/test/test_signal.py 2009-05-26 06:40:28 UTC (rev 6379) +++ trunk/jython/Lib/test/test_signal.py 2009-05-26 06:49:37 UTC (rev 6380) @@ -20,7 +20,8 @@ import traceback import sys, os, time, errno -if sys.platform[:3] in ('win', 'os2') or sys.platform == 'riscos': +if (sys.platform[:3] in ('win', 'os2') or sys.platform == 'riscos' or + (test_support.is_jython and os._name == 'nt')): raise test_support.TestSkipped("Can't test signal on %s" % \ sys.platform) Modified: trunk/jython/Lib/test/test_traceback.py =================================================================== --- trunk/jython/Lib/test/test_traceback.py 2009-05-26 06:40:28 UTC (rev 6379) +++ trunk/jython/Lib/test/test_traceback.py 2009-05-26 06:49:37 UTC (rev 6380) @@ -1,5 +1,6 @@ """Test cases for traceback module""" +from __future__ import with_statement import unittest from test.test_support import run_unittest, is_jython @@ -62,7 +63,8 @@ try: sys.path.insert(0, testdir) testfile = os.path.join(testdir, 'test_bug737473.py') - print >> open(testfile, 'w'), """ + with open(testfile, 'w') as fp: + print >> fp, """ def test(): raise ValueError""" @@ -84,7 +86,8 @@ # three seconds are needed for this test to pass reliably :-( time.sleep(4) - print >> open(testfile, 'w'), """ + with open(testfile, 'w') as fp: + print >> fp, """ def test(): raise NotImplementedError""" reload(test_bug737473) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |