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
53386d8f
Commit
53386d8f
authored
Aug 01, 2012
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15463: Write a test for faulthandler truncating the name of functions
to 500 characters.
parent
98a387b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
Lib/test/test_faulthandler.py
Lib/test/test_faulthandler.py
+24
-0
No files found.
Lib/test/test_faulthandler.py
View file @
53386d8f
...
...
@@ -316,6 +316,30 @@ funcA()
with
temporary_filename
()
as
filename
:
self
.
check_dump_traceback
(
filename
)
def
test_truncate
(
self
):
maxlen
=
500
func_name
=
'x'
*
(
maxlen
+
50
)
truncated
=
'x'
*
maxlen
+
'...'
code
=
"""
import faulthandler
def {func_name}():
faulthandler.dump_traceback(all_threads=False)
{func_name}()
"""
.
strip
()
code
=
code
.
format
(
func_name
=
func_name
,
)
expected
=
[
'Traceback (most recent call first):'
,
' File "<string>", line 4 in %s'
%
truncated
,
' File "<string>", line 6 in <module>'
]
trace
,
exitcode
=
self
.
get_output
(
code
)
self
.
assertEqual
(
trace
,
expected
)
self
.
assertEqual
(
exitcode
,
0
)
@
unittest
.
skipIf
(
not
HAVE_THREADS
,
'need threads'
)
def
check_dump_traceback_threads
(
self
,
filename
):
"""
...
...
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