()
| 30 | |
| 31 | |
| 32 | def 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 | |
| 56 | load_env_for_tests() |
no test coverage detected