MCPcopy Index your code
hub / github.com/google/adk-python / get_test_files

Function get_test_files

tests/unittests/test_samples.py:28–50  ·  view source on GitHub ↗

Yields (sample_dir, test_file_path).

()

Source from the content-addressed store, hash-verified

26
27
28def 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(

Callers

nothing calls this directly

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected