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

Function pytest_generate_tests

tests/integration/conftest.py:95–111  ·  view source on GitHub ↗
(metafunc: Metafunc)

Source from the content-addressed store, hash-verified

93
94@hookimpl(tryfirst=True)
95def pytest_generate_tests(metafunc: Metafunc):
96 if llm_backend.__name__ in metafunc.fixturenames:
97 if not _is_explicitly_marked(llm_backend.__name__, metafunc):
98 test_backend = os.environ.get('TEST_BACKEND', 'BOTH')
99 if test_backend == 'GOOGLE_AI_ONLY':
100 metafunc.parametrize(llm_backend.__name__, ['GOOGLE_AI'], indirect=True)
101 elif test_backend == 'VERTEX_ONLY':
102 metafunc.parametrize(llm_backend.__name__, ['VERTEX'], indirect=True)
103 elif test_backend == 'BOTH':
104 metafunc.parametrize(
105 llm_backend.__name__, ['GOOGLE_AI', 'VERTEX'], indirect=True
106 )
107 else:
108 raise ValueError(
109 f'Invalid TEST_BACKEND value: {test_backend}, should be one of'
110 ' [GOOGLE_AI_ONLY, VERTEX_ONLY, BOTH]'
111 )
112
113
114def _is_explicitly_marked(mark_name: str, metafunc: Metafunc) -> bool:

Callers

nothing calls this directly

Calls 2

_is_explicitly_markedFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected