Gregory P. Smith <g...@krypto.org> added the comment:

fyi - handy command to get that

python -m test.regrtest -v test_subprocess | ts '.%s'

then process that using whatever you want to compute deltas and sort.  i fed 
the output of that into:

```
#!/usr/bin/python3
"""Parse `python -m test.regrtest -v | ts '.%s'` output, report slowest."""

import sys
from typing import Sequence, Tuple


infile = sys.stdin

deltas: Sequence[Tuple[float, str]] = []

prev_secs: float = 0.
prev_test: str = ''
for line in infile:
  stripped_line = line.strip()
  if ' ' not in stripped_line:
    continue
  num, test = stripped_line.split(None, 1)
  secs = float(num)
  delta = secs - prev_secs if prev_secs else 0.
  if '... ok' or '... skipped' in test:  # Not extraneous output.
    # Assign the accumulated time to the previous test.
    deltas.append((delta, prev_test))
    prev_secs = secs
    prev_test = test

for secs, test in reversed(sorted(deltas, key=lambda x:x[0])[-23:]):
  print(f'{secs:.3} {test}')
```

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38456>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to