summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_traceback.py
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2004-11-01 08:26:09 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2004-11-01 08:26:09 (GMT)
commit4a8d8519106789688d9a10a5c20e7b0d29b70024 (patch)
tree7385dcd94438ceec02e3e50f20220c195be055ea /Lib/test/test_traceback.py
parent87d6fc51613f68290dd5ede44bd0bd980c354368 (diff)
downloadcpython-4a8d8519106789688d9a10a5c20e7b0d29b70024.zip
cpython-4a8d8519106789688d9a10a5c20e7b0d29b70024.tar.gz
cpython-4a8d8519106789688d9a10a5c20e7b0d29b70024.tar.bz2
Bug #1057993: Use sleep() always instead of os.utime() possibly broken
in some platforms.
Diffstat (limited to 'Lib/test/test_traceback.py')
-rw-r--r--Lib/test/test_traceback.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index e8777da..8b55401 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -52,15 +52,6 @@ class TracebackCases(unittest.TestCase):
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 @@ def test():
# 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"""