bpo-33718: regrtest keeps filters to re-run fails (GH-7291) · python/cpython@9e24930 (original) (raw)

`@@ -282,7 +282,6 @@ def rerun_failed_tests(self):

`

282

282

`self.ns.verbose = True

`

283

283

`self.ns.failfast = False

`

284

284

`self.ns.verbose3 = False

`

285

``

`-

self.ns.match_tests = None

`

286

285

``

287

286

`print()

`

288

287

`print("Re-running failed tests in verbose mode")

`

`@@ -313,7 +312,7 @@ def display_result(self):

`

313

312

`return

`

314

313

``

315

314

`print()

`

316

``

`-

print("== Tests result ==")

`

``

315

`+

print("== Tests result: %s ==" % self.get_tests_result())

`

317

316

``

318

317

`if self.interrupted:

`

319

318

`print()

`

`@@ -324,11 +323,6 @@ def display_result(self):

`

324

323

`print(count(len(omitted), "test"), "omitted:")

`

325

324

`printlist(omitted)

`

326

325

``

327

``

`-

if self.rerun:

`

328

``

`-

print()

`

329

``

`-

print(count(len(self.rerun), "test"), "re-run tests:")

`

330

``

`-

printlist(self.rerun)

`

331

``

-

332

326

`if self.good and not self.ns.quiet:

`

333

327

`print()

`

334

328

`if (not self.bad

`

`@@ -361,6 +355,11 @@ def display_result(self):

`

361

355

`print(count(len(self.skipped), "test"), "skipped:")

`

362

356

`printlist(self.skipped)

`

363

357

``

``

358

`+

if self.rerun:

`

``

359

`+

print()

`

``

360

`+

print("%s:" % count(len(self.rerun), "re-run test"))

`

``

361

`+

printlist(self.rerun)

`

``

362

+

364

363

`def run_tests_sequential(self):

`

365

364

`if self.ns.trace:

`

366

365

`import trace

`

`@@ -445,6 +444,21 @@ def display_header(self):

`

445

444

`% (locale.getpreferredencoding(False),

`

446

445

`sys.getfilesystemencoding()))

`

447

446

``

``

447

`+

def get_tests_result(self):

`

``

448

`+

result = []

`

``

449

`+

if self.bad:

`

``

450

`+

result.append("FAILURE")

`

``

451

`+

elif self.ns.fail_env_changed and self.environment_changed:

`

``

452

`+

result.append("ENV CHANGED")

`

``

453

+

``

454

`+

if self.interrupted:

`

``

455

`+

result.append("INTERRUPTED")

`

``

456

+

``

457

`+

if not result:

`

``

458

`+

result.append("SUCCESS")

`

``

459

+

``

460

`+

return ', '.join(result)

`

``

461

+

448

462

`def run_tests(self):

`

449

463

`# For a partial run, we do not need to clutter the output.

`

450

464

`if (self.ns.header

`

`@@ -486,16 +500,7 @@ def finalize(self):

`

486

500

`print()

`

487

501

`duration = time.monotonic() - self.start_time

`

488

502

`print("Total duration: %s" % format_duration(duration))

`

489

``

-

490

``

`-

if self.bad:

`

491

``

`-

result = "FAILURE"

`

492

``

`-

elif self.interrupted:

`

493

``

`-

result = "INTERRUPTED"

`

494

``

`-

elif self.ns.fail_env_changed and self.environment_changed:

`

495

``

`-

result = "ENV CHANGED"

`

496

``

`-

else:

`

497

``

`-

result = "SUCCESS"

`

498

``

`-

print("Tests result: %s" % result)

`

``

503

`+

print("Tests result: %s" % self.get_tests_result())

`

499

504

``

500

505

`if self.ns.runleaks:

`

501

506

`os.system("leaks %d" % os.getpid())

`