Use new enterprise env variable for Gemini calls#14199
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the environment variable key from GOOGLE_GENAI_USE_VERTEXAI to GOOGLE_GENAI_USE_ENTERPRISE in the test file. Feedback indicates that setting environment variables at the module level can cause side effects by modifying global state and suggests that the specific variable is unused in this context, recommending its removal or the use of a scoped fixture like monkeypatch for better test isolation.
| import templatefolder_with_txt | ||
|
|
||
| os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True" | ||
| os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True" |
There was a problem hiding this comment.
Setting environment variables at the module level in tests modifies global state and can cause side effects. Additionally, 'GOOGLE_GENAI_USE_ENTERPRISE' is not used by 'templatefolder_with_txt.py', making this dead code in this context. For a template, it is better to remove unnecessary boilerplate or use a scoped fixture (e.g., 'monkeypatch') to ensure test isolation.
Description
Fixes #14198
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
nox -s py-3.9(see Test Environment Setup)nox -s lint(see Test Environment Setup)Changes GOOGLE_GENAI_USE_VERTEXAI to GOOGLE_GENAI_USE_ENTERPRISE