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

Function load_env_for_tests

tests/integration/conftest.py:32–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31
32def load_env_for_tests():
33 dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
34 if not os.path.exists(dotenv_path):
35 warnings.warn(
36 f'Missing .env file at {dotenv_path}. See dotenv.sample for an example.'
37 )
38 else:
39 load_dotenv(dotenv_path, override=True, verbose=True)
40 if 'GOOGLE_API_KEY' not in os.environ:
41 warnings.warn(
42 'Missing GOOGLE_API_KEY in the environment variables. GOOGLE_AI backend'
43 ' integration tests will fail.'
44 )
45 for env_var in [
46 'GOOGLE_CLOUD_PROJECT',
47 'GOOGLE_CLOUD_LOCATION',
48 ]:
49 if env_var not in os.environ:
50 warnings.warn(
51 f'Missing {env_var} in the environment variables. Vertex backend'
52 ' integration tests will fail.'
53 )
54
55
56load_env_for_tests()

Callers 1

conftest.pyFile · 0.85

Calls 3

warnMethod · 0.80
joinMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected