(paired_test, options, test_labels, start_at, start_after)
| 491 | |
| 492 | |
| 493 | def paired_tests(paired_test, options, test_labels, start_at, start_after): |
| 494 | if not test_labels: |
| 495 | test_labels = collect_test_modules(start_at, start_after) |
| 496 | |
| 497 | print("***** Trying paired execution") |
| 498 | |
| 499 | # Make sure the constant member of the pair isn't in the test list |
| 500 | # Also remove tests that need to be run in specific combinations |
| 501 | for label in [paired_test, "model_inheritance_same_model_name"]: |
| 502 | try: |
| 503 | test_labels.remove(label) |
| 504 | except ValueError: |
| 505 | pass |
| 506 | |
| 507 | subprocess_args = get_subprocess_args(options) |
| 508 | |
| 509 | for i, label in enumerate(test_labels): |
| 510 | print( |
| 511 | "***** %d of %d: Check test pairing with %s" |
| 512 | % (i + 1, len(test_labels), label) |
| 513 | ) |
| 514 | failures = subprocess.call(subprocess_args + [label, paired_test]) |
| 515 | if failures: |
| 516 | print("***** Found problem pair with %s" % label) |
| 517 | return |
| 518 | |
| 519 | print("***** No problem pair found") |
| 520 | |
| 521 | |
| 522 | if __name__ == "__main__": |
no test coverage detected