(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)
| 610 | return list(match.group(1) for match in parser) |
| 611 | |
| 612 | def check_executed_tests(self, output, tests, *, stats, |
| 613 | skipped=(), failed=(), |
| 614 | env_changed=(), omitted=(), |
| 615 | rerun=None, run_no_tests=(), |
| 616 | resource_denied=(), |
| 617 | randomize=False, parallel=False, interrupted=False, |
| 618 | fail_env_changed=False, |
| 619 | forever=False, filtered=False): |
| 620 | if isinstance(tests, str): |
| 621 | tests = [tests] |
| 622 | if isinstance(skipped, str): |
| 623 | skipped = [skipped] |
| 624 | if isinstance(resource_denied, str): |
| 625 | resource_denied = [resource_denied] |
| 626 | if isinstance(failed, str): |
| 627 | failed = [failed] |
| 628 | if isinstance(env_changed, str): |
| 629 | env_changed = [env_changed] |
| 630 | if isinstance(omitted, str): |
| 631 | omitted = [omitted] |
| 632 | if isinstance(run_no_tests, str): |
| 633 | run_no_tests = [run_no_tests] |
| 634 | if isinstance(stats, int): |
| 635 | stats = TestStats(stats) |
| 636 | if parallel: |
| 637 | randomize = True |
| 638 | |
| 639 | rerun_failed = [] |
| 640 | if rerun is not None and not env_changed: |
| 641 | failed = [rerun.name] |
| 642 | if not rerun.success: |
| 643 | rerun_failed.append(rerun.name) |
| 644 | |
| 645 | executed = self.parse_executed_tests(output) |
| 646 | total_tests = list(tests) |
| 647 | if rerun is not None: |
| 648 | total_tests.append(rerun.name) |
| 649 | if randomize: |
| 650 | self.assertEqual(set(executed), set(total_tests), output) |
| 651 | else: |
| 652 | self.assertEqual(executed, total_tests, output) |
| 653 | |
| 654 | def plural(count): |
| 655 | return 's' if count != 1 else '' |
| 656 | |
| 657 | def list_regex(line_format, tests): |
| 658 | count = len(tests) |
| 659 | names = ' '.join(sorted(tests)) |
| 660 | regex = line_format % (count, plural(count)) |
| 661 | regex = r'%s:\n %s$' % (regex, names) |
| 662 | return regex |
| 663 | |
| 664 | if skipped: |
| 665 | regex = list_regex('%s test%s skipped', skipped) |
| 666 | self.check_line(output, regex) |
| 667 | |
| 668 | if resource_denied: |
| 669 | regex = list_regex(r'%s test%s skipped \(resource denied\)', resource_denied) |
no test coverage detected