|
17 | 17 | import os
|
18 | 18 | import statistics
|
19 | 19 | from unittest import mock
|
20 |
| -import warnings |
21 | 20 |
|
22 | 21 | import google.auth.credentials
|
23 | 22 | from google.cloud import aiplatform
|
|
29 | 28 | from vertexai._genai import evals
|
30 | 29 | from vertexai._genai import types as vertexai_genai_types
|
31 | 30 | from google.genai import client
|
32 |
| -from google.genai import errors as genai_errors |
33 | 31 | from google.genai import types as genai_types
|
34 | 32 | import pandas as pd
|
35 | 33 | import pytest
|
@@ -148,20 +146,6 @@ def setup_method(self):
|
148 | 146 | )
|
149 | 147 | self.client = vertexai.Client(project=_TEST_PROJECT, location=_TEST_LOCATION)
|
150 | 148 |
|
151 |
| - @pytest.mark.usefixtures("google_auth_mock") |
152 |
| - @mock.patch.object(client.Client, "_get_api_client") |
153 |
| - @mock.patch.object(evals.Evals, "_evaluate_instances") |
154 |
| - def test_evaluate_instances(self, mock_evaluate, mock_get_api_client): |
155 |
| - with warnings.catch_warnings(record=True) as captured_warnings: |
156 |
| - warnings.simplefilter("always") |
157 |
| - self.client.evals._evaluate_instances( |
158 |
| - bleu_input=vertexai_genai_types.BleuInput() |
159 |
| - ) |
160 |
| - mock_evaluate.assert_called_once_with( |
161 |
| - bleu_input=vertexai_genai_types.BleuInput() |
162 |
| - ) |
163 |
| - assert captured_warnings[0].category == genai_errors.ExperimentalWarning |
164 |
| - |
165 | 149 | @pytest.mark.usefixtures("google_auth_mock")
|
166 | 150 | def test_eval_run(self):
|
167 | 151 | test_client = vertexai.Client(project=_TEST_PROJECT, location=_TEST_LOCATION)
|
|
0 commit comments