#17143: merge with 3.3.
This commit is contained in:
commit
1758d9cf8e
|
@ -3,7 +3,6 @@ import io
|
||||||
import sys
|
import sys
|
||||||
from test.support import (run_unittest, TESTFN, rmtree, unlink,
|
from test.support import (run_unittest, TESTFN, rmtree, unlink,
|
||||||
captured_stdout)
|
captured_stdout)
|
||||||
import tempfile
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import trace
|
import trace
|
||||||
|
@ -396,13 +395,15 @@ class TestDeprecatedMethods(unittest.TestCase):
|
||||||
trace.find_lines(foo.__code__, ["eggs"])
|
trace.find_lines(foo.__code__, ["eggs"])
|
||||||
|
|
||||||
def test_deprecated_find_strings(self):
|
def test_deprecated_find_strings(self):
|
||||||
|
with open(TESTFN, 'w') as fd:
|
||||||
|
self.addCleanup(unlink, TESTFN)
|
||||||
with self.assertWarns(DeprecationWarning):
|
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):
|
def test_deprecated_find_executable_linenos(self):
|
||||||
|
with open(TESTFN, 'w') as fd:
|
||||||
|
self.addCleanup(unlink, TESTFN)
|
||||||
with self.assertWarns(DeprecationWarning):
|
with self.assertWarns(DeprecationWarning):
|
||||||
with tempfile.NamedTemporaryFile() as fd:
|
|
||||||
trace.find_executable_linenos(fd.name)
|
trace.find_executable_linenos(fd.name)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue