(metafunc: Metafunc)
| 93 | |
| 94 | @hookimpl(tryfirst=True) |
| 95 | def 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 | |
| 114 | def _is_explicitly_marked(mark_name: str, metafunc: Metafunc) -> bool: |
nothing calls this directly
no test coverage detected