(self, output, tests, *, stats,
skipped=(), failed=(),
env_changed=(), omitted=(),
rerun=None, run_no_tests=(),
resource_denied=(),
randomize=False, parallel=False, interrupted=False,
fail_env_changed=False,
forever=False, filtered=False)
| 648 | return list(match.group(1) for match in parser) |
| 649 | |
| 650 | def check_executed_tests(self, output, tests, *, stats, |
| 651 | skipped=(), failed=(), |
| 652 | env_changed=(), omitted=(), |
| 653 | rerun=None, run_no_tests=(), |
| 654 | resource_denied=(), |
| 655 | randomize=False, parallel=False, interrupted=False, |
| 656 | fail_env_changed=False, |
| 657 | forever=False, filtered=False): |
| 658 | if isinstance(tests, str): |
| 659 | tests = [tests] |
| 660 | if isinstance(skipped, str): |
| 661 | skipped = [skipped] |
| 662 | if isinstance(resource_denied, str): |
| 663 | resource_denied = [resource_denied] |
| 664 | if isinstance(failed, str): |
| 665 | failed = [failed] |
| 666 | if isinstance(env_changed, str): |
| 667 | env_changed = [env_changed] |
| 668 | if isinstance(omitted, str): |
| 669 | omitted = [omitted] |
| 670 | if isinstance(run_no_tests, str): |
| 671 | run_no_tests = [run_no_tests] |
| 672 | if isinstance(stats, int): |
| 673 | stats = TestStats(stats) |
| 674 | if parallel: |
| 675 | randomize = True |
| 676 | |
| 677 | rerun_failed = [] |
| 678 | if rerun is not None and not env_changed: |
| 679 | failed = [rerun.name] |
| 680 | if not rerun.success: |
| 681 | rerun_failed.append(rerun.name) |
| 682 | |
| 683 | executed = self.parse_executed_tests(output) |
| 684 | total_tests = list(tests) |
| 685 | if rerun is not None: |
| 686 | total_tests.append(rerun.name) |
| 687 | if randomize: |
| 688 | self.assertEqual(set(executed), set(total_tests), output) |
| 689 | else: |
| 690 | self.assertEqual(executed, total_tests, output) |
| 691 | |
| 692 | def plural(count): |
| 693 | return 's' if count != 1 else '' |
| 694 | |
| 695 | def list_regex(line_format, tests): |
| 696 | count = len(tests) |
| 697 | names = ' '.join(sorted(tests)) |
| 698 | regex = line_format % (count, plural(count)) |
| 699 | regex = r'%s:\n %s$' % (regex, names) |
| 700 | return regex |
| 701 | |
| 702 | if skipped: |
| 703 | regex = list_regex('%s test%s skipped', skipped) |
| 704 | self.check_line(output, regex) |
| 705 | |
| 706 | if resource_denied: |
| 707 | regex = list_regex(r'%s test%s skipped \(resource denied\)', resource_denied) |
no test coverage detected