We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca97c58 commit fa19c53Copy full SHA for fa19c53
7 files changed
google/genai/tests/conftest.py
@@ -61,6 +61,12 @@ def replays_prefix():
61
return 'test'
62
63
64
+# Overridden at the module level for each test file.
65
+@pytest.fixture
66
+def location():
67
+ return None
68
+
69
70
def _get_replay_id(use_vertex: bool, replays_prefix: str) -> str:
71
test_name_ending = os.environ.get('PYTEST_CURRENT_TEST').split('::')[-1]
72
test_name = (
@@ -72,7 +78,7 @@ def _get_replay_id(use_vertex: bool, replays_prefix: str) -> str:
78
73
79
74
80
@pytest.fixture
75
-def client(use_vertex, replays_prefix, http_options, request):
81
+def client(use_vertex, replays_prefix, http_options, location, request):
76
82
mode = request.config.getoption('--mode')
77
83
if mode not in ['auto', 'record', 'replay', 'api', 'tap']:
84
raise ValueError('Invalid mode: ' + mode)
@@ -121,6 +127,7 @@ def client(use_vertex, replays_prefix, http_options, request):
121
127
vertexai=use_vertex,
122
128
http_options=http_options,
123
129
private=private,
130
+ location=location,
124
131
)
125
132
126
133
with mock.patch.object(
google/genai/tests/pytest_helper.py
@@ -143,6 +143,7 @@ def setup(
143
test_method: Optional[str] = None,
144
test_table: Optional[list[TestTableItem]] = None,
145
http_options: Optional[HttpOptions] = None,
146
+ location: Optional[str] = None,
147
):
148
"""Generates parameterization for tests, run for both Vertex and MLDev."""
149
replays_directory = (
@@ -192,10 +193,10 @@ def setup(
192
193
194
# Add fixture for requested client option.
195
return pytest.mark.parametrize(
- 'use_vertex, replays_prefix, http_options',
196
+ 'use_vertex, replays_prefix, http_options, location',
197
[
- (True, replays_directory, http_options),
198
- (False, replays_directory, http_options),
+ (True, replays_directory, http_options, location),
199
+ (False, replays_directory, http_options, location),
200
],
201
202
google/genai/tests/shared/__init__.py
@@ -13,4 +13,4 @@
13
# limitations under the License.
14
#
15
16
-GEMINI_MODEL = 'gemini-3.1-pro-preview' # Gemini only
+GEMINI_MODEL = 'gemini-3.5-flash' # Gemini only
google/genai/tests/shared/models/test_embed.py
@@ -34,7 +34,7 @@
34
pytest_helper.TestTableItem(
35
name='test_embed_gemini_embedding_2',
36
parameters=genai_types.EmbedContentParameters(
37
- model='gemini-embedding-2-preview',
+ model='gemini-embedding-2',
38
contents='Hello world!',
39
config={
40
'output_dimensionality': 10,
google/genai/tests/shared/tunings/__init__.py
@@ -11,5 +11,4 @@
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
-# GEMINI_TUNABLE_MODEL = 'gemini-3.1-flash-lite'
-GEMINI_TUNABLE_MODEL = 'gemini-2.5-pro'
+GEMINI_TUNABLE_MODEL = 'gemini-3.5-flash'
google/genai/tests/shared/tunings/test_create.py
@@ -43,6 +43,8 @@
43
globals_for_file=globals(),
44
test_method='tunings.tune',
45
test_table=test_table,
46
+ # Ignore the env var and always set the location to us-central1
47
+ location='us-central1',
48
49
50
pytest_plugins = ('pytest_asyncio',)
google/genai/tests/shared/tunings/test_create_get_cancel.py
@@ -54,6 +54,8 @@ def create_get_cancel(client, parameters):
54
55
test_method="create_get_cancel",
56
57
58
+ location="us-central1",
59
60
pytest_plugins = ("pytest_asyncio",)
0 commit comments