Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
96b531ab
Commit
96b531ab
authored
Jan 11, 2016
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26069: Remove the deprecated apis in the trace module.
parent
f7272a66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
90 deletions
+3
-90
Lib/test/test_trace.py
Lib/test/test_trace.py
+1
-47
Lib/trace.py
Lib/trace.py
+0
-43
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_trace.py
View file @
96b531ab
import
os
import
io
import
sys
from
test.support
import
TESTFN
,
rmtree
,
unlink
,
captured_stdout
import
unittest
import
trace
from
trace
import
CoverageResults
,
Trace
from
trace
import
Trace
from
test.tracedmodules
import
testmod
...
...
@@ -366,50 +365,5 @@ class Test_Ignore(unittest.TestCase):
self
.
assertTrue
(
ignore
.
names
(
jn
(
'bar'
,
'baz.py'
),
'baz'
))
class
TestDeprecatedMethods
(
unittest
.
TestCase
):
def
test_deprecated_usage
(
self
):
sio
=
io
.
StringIO
()
with
self
.
assertWarns
(
DeprecationWarning
):
trace
.
usage
(
sio
)
self
.
assertIn
(
'Usage:'
,
sio
.
getvalue
())
def
test_deprecated_Ignore
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
trace
.
Ignore
()
def
test_deprecated_modname
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
self
.
assertEqual
(
"spam"
,
trace
.
modname
(
"spam"
))
def
test_deprecated_fullmodname
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
self
.
assertEqual
(
"spam"
,
trace
.
fullmodname
(
"spam"
))
def
test_deprecated_find_lines_from_code
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
def
foo
():
pass
trace
.
find_lines_from_code
(
foo
.
__code__
,
[
"eggs"
])
def
test_deprecated_find_lines
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
def
foo
():
pass
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
):
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
):
trace
.
find_executable_linenos
(
fd
.
name
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Lib/trace.py
View file @
96b531ab
...
...
@@ -58,7 +58,6 @@ import inspect
import
gc
import
dis
import
pickle
from
warnings
import
warn
as
_warn
from
time
import
monotonic
as
_time
try
:
...
...
@@ -810,47 +809,5 @@ def main(argv=None):
if
not
no_report
:
results
.
write_results
(
missing
,
summary
=
summary
,
coverdir
=
coverdir
)
# Deprecated API
def
usage
(
outfile
):
_warn
(
"The trace.usage() function is deprecated"
,
DeprecationWarning
,
2
)
_usage
(
outfile
)
class
Ignore
(
_Ignore
):
def
__init__
(
self
,
modules
=
None
,
dirs
=
None
):
_warn
(
"The class trace.Ignore is deprecated"
,
DeprecationWarning
,
2
)
_Ignore
.
__init__
(
self
,
modules
,
dirs
)
def
modname
(
path
):
_warn
(
"The trace.modname() function is deprecated"
,
DeprecationWarning
,
2
)
return
_modname
(
path
)
def
fullmodname
(
path
):
_warn
(
"The trace.fullmodname() function is deprecated"
,
DeprecationWarning
,
2
)
return
_fullmodname
(
path
)
def
find_lines_from_code
(
code
,
strs
):
_warn
(
"The trace.find_lines_from_code() function is deprecated"
,
DeprecationWarning
,
2
)
return
_find_lines_from_code
(
code
,
strs
)
def
find_lines
(
code
,
strs
):
_warn
(
"The trace.find_lines() function is deprecated"
,
DeprecationWarning
,
2
)
return
_find_lines
(
code
,
strs
)
def
find_strings
(
filename
,
encoding
=
None
):
_warn
(
"The trace.find_strings() function is deprecated"
,
DeprecationWarning
,
2
)
return
_find_strings
(
filename
,
encoding
=
None
)
def
find_executable_linenos
(
filename
):
_warn
(
"The trace.find_executable_linenos() function is deprecated"
,
DeprecationWarning
,
2
)
return
_find_executable_linenos
(
filename
)
if
__name__
==
'__main__'
:
main
()
Misc/NEWS
View file @
96b531ab
...
...
@@ -128,6 +128,8 @@ Core and Builtins
Library
-------
- Issue #26069: Remove the deprecated apis in the trace module.
- Issue #22138: Fix mock.patch behavior when patching descriptors. Restore
original values after patching. Patch contributed by Sean McCully.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment