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
ac9240b9
Commit
ac9240b9
authored
May 09, 2018
by
jdemeyer
Committed by
Benjamin Peterson
May 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
closes bpo-33445: fail properly in test_cprofile() (GH-6727)
parent
43d12a6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
Lib/test/test_profile.py
Lib/test/test_profile.py
+11
-6
No files found.
Lib/test/test_profile.py
View file @
ac9240b9
...
...
@@ -51,13 +51,18 @@ class ProfileTest(unittest.TestCase):
results
=
self
.
do_profiling
()
expected
=
self
.
get_expected_output
()
self
.
assertEqual
(
results
[
0
],
1000
)
fail
=
[]
for
i
,
method
in
enumerate
(
self
.
methodnames
):
if
results
[
i
+
1
]
!=
expected
[
method
]:
print
(
"Stats.%s output for %s doesn't fit expectation!"
%
(
method
,
self
.
profilerclass
.
__name__
))
print
(
'
\
n
'
.
join
(
unified_diff
(
results
[
i
+
1
].
split
(
'
\
n
'
),
expected
[
method
].
split
(
'
\
n
'
))))
a
=
expected
[
method
]
b
=
results
[
i
+
1
]
if
a
!=
b
:
fail
.
append
(
f"
\
n
Stats.
{
method
}
output for "
f"
{
self
.
profilerclass
.
__name__
}
"
"does not fit expectation:"
)
fail
.
extend
(
unified_diff
(
a
.
split
(
'
\
n
'
),
b
.
split
(
'
\
n
'
),
lineterm
=
""
))
if
fail
:
self
.
fail
(
"
\
n
"
.
join
(
fail
))
def
test_calling_conventions
(
self
):
# Issue #5330: profile and cProfile wouldn't report C functions called
...
...
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