Skip to content

Commit 35519ad

Browse files
fthoelecopybara-github
authored andcommitted
chore: skip offline_store tests in python <3.10
PiperOrigin-RevId: 740914413
1 parent 6383a52 commit 35519ad

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

tests/unit/aiplatform/test_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ def test_get_experiment_df_passes_experiment_variable(
20762076
_, kwargs = query_experiment_row_mock.call_args_list[0]
20772077
TestCase.assertTrue(self, kwargs["experiment"].name == _TEST_EXPERIMENT)
20782078

2079-
@pytest.mark.skipif(sys.version_info == (3, 9), reason="flaky")
2079+
@pytest.mark.skipif(sys.version_info <= (3, 9), reason="flaky")
20802080
@pytest.mark.usefixtures(
20812081
"get_experiment_mock",
20822082
"list_tensorboard_time_series_mock",

tests/unit/vertexai/test_offline_store.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919
from unittest import mock
2020
import pytest
2121
import sys
22+
from google import auth
2223
from vertexai.resources.preview.feature_store import (
2324
offline_store,
2425
FeatureGroup,
2526
Feature,
2627
)
2728

28-
pytestmark = pytest.mark.skipif(
29-
sys.version_info == (3, 8), reason="bigframes is not supported in Python 3.8"
30-
)
29+
pytestmark = [
30+
pytest.mark.skipif(
31+
sys.version_info < (3, 10), reason="bigframes is not supported in Python < 3.10"
32+
),
33+
pytest.mark.usefixtures("google_auth_mock"),
34+
]
3135

3236
try:
3337
import pandas as pd
@@ -131,7 +135,16 @@ def select_dtypes(self, *args):
131135
import bigframes.pandas as bpd # noqa: E402
132136

133137

134-
pytestmark = pytest.mark.usefixtures("google_auth_mock")
138+
@pytest.fixture()
139+
def google_auth_mock():
140+
with mock.patch.object(auth, "default") as google_auth_mock:
141+
credentials_mock = mock.Mock()
142+
credentials_mock.with_quota_project.return_value = None
143+
google_auth_mock.return_value = (
144+
credentials_mock,
145+
"test-project",
146+
)
147+
yield google_auth_mock
135148

136149

137150
@pytest.fixture()

0 commit comments

Comments
 (0)