#17143: fix buildbot failures on Windows.

This commit is contained in:
Ezio Melotti 2013-02-20 02:52:49 +02:00
parent 6cd6f01556
commit 5a9ce077e0
1 changed files with 6 additions and 5 deletions

View 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,13 +395,15 @@ 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)
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)