|
5 | 5 |
|
6 | 6 | from __future__ import annotations |
7 | 7 |
|
8 | | -import os |
9 | 8 | from itertools import chain |
10 | 9 | from logging import getLogger |
11 | 10 | from math import ceil, log |
| 11 | +from os import linesep |
12 | 12 | from pathlib import Path |
13 | 13 | from time import time |
14 | 14 | from typing import TYPE_CHECKING |
@@ -651,20 +651,18 @@ def run( |
651 | 651 | # otherwise, ensure the first found signature is used throughout |
652 | 652 | self._signature = replay.signature |
653 | 653 |
|
654 | | - if best_results: |
655 | | - self.report(best_results, self.testcases, update_status=True) |
656 | | - for result, reduction in other_results.values(): |
657 | | - self.report([result], reduction) |
658 | | - |
659 | 654 | except KeyboardInterrupt: |
660 | 655 | if best_results: |
661 | | - self.report(best_results, self.testcases, update_status=True) |
662 | 656 | LOG.warning( |
663 | 657 | "Ctrl+C detected, best reduction so far reported as %r", |
664 | 658 | self._status.last_reports, |
665 | 659 | ) |
666 | 660 | raise |
667 | 661 | finally: |
| 662 | + if best_results: |
| 663 | + self.report(best_results, self.testcases, update_status=True) |
| 664 | + for result, reduction in other_results.values(): |
| 665 | + self.report([result], reduction) |
668 | 666 | for result in best_results: |
669 | 667 | result.report.cleanup() |
670 | 668 | for result, reduction in other_results.values(): |
@@ -696,7 +694,7 @@ def run( |
696 | 694 | # log a summary of what was done. |
697 | 695 | LOG.info( |
698 | 696 | "Reduction summary:%s%s", |
699 | | - os.linesep, |
| 697 | + linesep, |
700 | 698 | ReductionStatusReporter([self._status]).summary(), |
701 | 699 | ) |
702 | 700 | self._status.report(force=True) |
|
0 commit comments