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
33e151dc
Commit
33e151dc
authored
Feb 15, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Plain Diff
#17143: merge with 3.3.
parents
0a569954
c3302265
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
0 deletions
+49
-0
Lib/test/test_trace.py
Lib/test/test_trace.py
+45
-0
Lib/trace.py
Lib/trace.py
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_trace.py
View file @
33e151dc
import
os
import
io
import
sys
from
test.support
import
(
run_unittest
,
TESTFN
,
rmtree
,
unlink
,
captured_stdout
)
import
tempfile
import
unittest
import
trace
...
...
@@ -361,6 +363,49 @@ 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
self
.
assertWarns
(
DeprecationWarning
):
with
tempfile
.
NamedTemporaryFile
()
as
fd
:
trace
.
find_strings
(
fd
.
name
)
def
test_deprecated_find_executable_linenos
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
with
tempfile
.
NamedTemporaryFile
()
as
fd
:
trace
.
find_executable_linenos
(
fd
.
name
)
def
test_main
():
run_unittest
(
__name__
)
...
...
Lib/trace.py
View file @
33e151dc
...
...
@@ -58,6 +58,7 @@ import inspect
import
gc
import
dis
import
pickle
from
warnings
import
warn
as
_warn
try
:
from
time
import
monotonic
as
_time
except
ImportError
:
...
...
Misc/NEWS
View file @
33e151dc
...
...
@@ -253,6 +253,9 @@ Core and Builtins
Library
-------
-
Issue
#
17143
:
Fix
a
missing
import
in
the
trace
module
.
Initial
patch
by
Berker
Peksag
.
-
Issue
#
15220
:
email
.
feedparser
's line splitting algorithm is now simpler and
faster.
...
...
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