faulthandler: dump_tracebacks_later() displays also the timeout

This commit is contained in:
Victor Stinner 2011-04-08 13:39:59 +02:00
parent 941893291a
commit c790a5346d
2 changed files with 52 additions and 4 deletions

View file

@ -1,4 +1,5 @@
from contextlib import contextmanager
import datetime
import faulthandler
import re
import signal
@ -360,6 +361,7 @@ Current thread XXX:
Raise an error if the output doesn't match the expect format.
"""
timeout_str = str(datetime.timedelta(seconds=TIMEOUT))
code = """
import faulthandler
import time
@ -399,7 +401,7 @@ if file is not None:
count = loops
if repeat:
count *= 2
header = 'Thread 0x[0-9a-f]+:\n'
header = r'Timeout \(%s\)!\nThread 0x[0-9a-f]+:\n' % timeout_str
regex = expected_traceback(9, 20, header, count=count)
self.assertRegex(trace, regex)
else: