MCPcopy
hub / github.com/django/django / paired_tests

Function paired_tests

tests/runtests.py:493–519  ·  view source on GitHub ↗
(paired_test, options, test_labels, start_at, start_after)

Source from the content-addressed store, hash-verified

491
492
493def 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
522if __name__ == "__main__":

Callers 1

runtests.pyFile · 0.85

Calls 4

collect_test_modulesFunction · 0.85
get_subprocess_argsFunction · 0.85
callMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected