#17143: fix buildbot failures on Windows.
authorEzio Melotti <ezio.melotti@gmail.com>
Wed, 20 Feb 2013 00:52:49 +0000 (02:52 +0200)
committerEzio Melotti <ezio.melotti@gmail.com>
Wed, 20 Feb 2013 00:52:49 +0000 (02:52 +0200)
Lib/test/test_trace.py

index b2cd728f687519e1d468f02389ef3b87430b8871..1cec710ee580faeaf5226ed2a8ae3a7c5093425c 100644 (file)
@@ -3,7 +3,6 @@ import io
 import sys
 from test.support import (run_unittest, TESTFN, rmtree, unlink,
                                captured_stdout)
-import tempfile
 import unittest
 
 import trace
@@ -396,14 +395,16 @@ class TestDeprecatedMethods(unittest.TestCase):
             trace.find_lines(foo.__code__, ["eggs"])
 
     def test_deprecated_find_strings(self):
+        with open(TESTFN, 'w') as fd:
+            self.addCleanup(unlink, TESTFN)
         with self.assertWarns(DeprecationWarning):
-            with tempfile.NamedTemporaryFile() as fd:
-                trace.find_strings(fd.name)
+            trace.find_strings(fd.name)
 
     def test_deprecated_find_executable_linenos(self):
+        with open(TESTFN, 'w') as fd:
+            self.addCleanup(unlink, TESTFN)
         with self.assertWarns(DeprecationWarning):
-            with tempfile.NamedTemporaryFile() as fd:
-                trace.find_executable_linenos(fd.name)
+            trace.find_executable_linenos(fd.name)
 
 
 def test_main():