[Python-checkins] python/dist/src/Lib/test test_traceback.py, 1.12, 1.13

perky at users.sourceforge.net perky at users.sourceforge.net
Mon Nov 1 09:26:14 CET 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31250/Lib/test

Modified Files:
	test_traceback.py 
Log Message:
Bug #1057993: Use sleep() always instead of os.utime() possibly broken
in some platforms.


Index: test_traceback.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_traceback.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- test_traceback.py	27 Oct 2004 03:12:05 -0000	1.12
+++ test_traceback.py	1 Nov 2004 08:26:09 -0000	1.13
@@ -52,15 +52,6 @@
 def test():
     raise ValueError"""
 
-            # if this test runs fast, test_bug737473.py will have same mtime
-            # even if it's rewrited and it'll not reloaded.  so adjust mtime
-            # of original to past.
-            if hasattr(os, 'utime'):
-                past = time.time() - 3
-                os.utime(testfile, (past, past))
-            else:
-                time.sleep(3)
-
             if 'test_bug737473' in sys.modules:
                 del sys.modules['test_bug737473']
             import test_bug737473
@@ -71,6 +62,11 @@
                 # this loads source code to linecache
                 traceback.extract_tb(sys.exc_traceback)
 
+            # If this test runs fast, test_bug737473.py will stay in a mtime
+            # even if it's rewrited and it'll not reloaded in result.  So wait
+            # until new timestamp comes.
+            time.sleep(2)
+
             print >> open(testfile, 'w'), """\
 def test():
     raise NotImplementedError"""



More information about the Python-checkins mailing list