Yields (sample_dir, test_file_path).
()
| 26 | |
| 27 | |
| 28 | def get_test_files(): |
| 29 | """Yields (sample_dir, test_file_path).""" |
| 30 | if not CONTRIBUTING_DIR.exists(): |
| 31 | return |
| 32 | for test_file in CONTRIBUTING_DIR.rglob("tests/*.json"): |
| 33 | sample_dir = test_file.parent.parent |
| 34 | if ( |
| 35 | (sample_dir / "agent.py").exists() |
| 36 | or (sample_dir / "__init__.py").exists() |
| 37 | or (sample_dir / "root_agent.yaml").exists() |
| 38 | ): |
| 39 | try: |
| 40 | rel_dir = sample_dir.relative_to(CONTRIBUTING_DIR) |
| 41 | test_id = f"{rel_dir}/{test_file.name}" |
| 42 | except ValueError: |
| 43 | test_id = f"{sample_dir.name}/{test_file.name}" |
| 44 | |
| 45 | if test_file.stem.endswith("_xfail"): |
| 46 | yield pytest.param( |
| 47 | sample_dir, test_file, id=test_id, marks=pytest.mark.xfail |
| 48 | ) |
| 49 | else: |
| 50 | yield pytest.param(sample_dir, test_file, id=test_id) |
| 51 | |
| 52 | |
| 53 | @pytest.mark.parametrize( |