Discover all available unit tests and examples. Args: project_dir: Project root directory (defaults to current directory) Returns: Tuple of (unit_tests, examples) where each is a list of (name, path) tuples
(
project_dir: Optional[Path] = None,
)
| 641 | |
| 642 | |
| 643 | def discover_all_tests( |
| 644 | project_dir: Optional[Path] = None, |
| 645 | ) -> "tuple[list[tuple[str, str]], list[tuple[str, str]]]": |
| 646 | """Discover all available unit tests and examples. |
| 647 | |
| 648 | Args: |
| 649 | project_dir: Project root directory (defaults to current directory) |
| 650 | |
| 651 | Returns: |
| 652 | Tuple of (unit_tests, examples) where each is a list of (name, path) tuples |
| 653 | """ |
| 654 | if project_dir is None: |
| 655 | project_dir = Path.cwd() |
| 656 | |
| 657 | # Find all tests and examples |
| 658 | unit_tests = _find_unit_tests(project_dir) |
| 659 | examples = _find_examples(project_dir) |
| 660 | |
| 661 | # Convert to (name, path) tuples |
| 662 | unit_test_tuples = [(m.name, m.path) for m in unit_tests] |
| 663 | example_tuples = [(m.name, m.path) for m in examples] |
| 664 | |
| 665 | return (unit_test_tuples, example_tuples) |