|
76 | 76 | ) |
77 | 77 |
|
78 | 78 |
|
| 79 | +_LINEAR_REGRESSION_CLASS = f"{LinearRegression.__module__}.LinearRegression" |
| 80 | + |
| 81 | + |
79 | 82 | @pytest.fixture |
80 | 83 | def mock_datetime_now(monkeypatch): |
81 | 84 | class DateTime(datetime.datetime): |
@@ -205,7 +208,7 @@ def mock_load_tensorflow_module_model(): |
205 | 208 | "frameworkName": "sklearn", |
206 | 209 | "frameworkVersion": "1.0", |
207 | 210 | "modelFile": "model.pkl", |
208 | | - "modelClass": "sklearn.linear_model._base.LinearRegression", |
| 211 | + "modelClass": _LINEAR_REGRESSION_CLASS, |
209 | 212 | }, |
210 | 213 | ) |
211 | 214 |
|
@@ -380,7 +383,7 @@ def test_save_model_sklearn( |
380 | 383 | "frameworkName": "sklearn", |
381 | 384 | "frameworkVersion": sklearn.__version__, |
382 | 385 | "modelFile": "model.pkl", |
383 | | - "modelClass": "sklearn.linear_model._base.LinearRegression", |
| 386 | + "modelClass": _LINEAR_REGRESSION_CLASS, |
384 | 387 | }, |
385 | 388 | state=GapicArtifact.State.LIVE, |
386 | 389 | ) |
@@ -433,7 +436,7 @@ def test_save_model_with_all_args( |
433 | 436 | "frameworkName": "sklearn", |
434 | 437 | "frameworkVersion": sklearn.__version__, |
435 | 438 | "modelFile": "model.pkl", |
436 | | - "modelClass": "sklearn.linear_model._base.LinearRegression", |
| 439 | + "modelClass": _LINEAR_REGRESSION_CLASS, |
437 | 440 | "predictSchemata": {"instanceSchemaUri": f"{_TEST_URI}/instance.yaml"}, |
438 | 441 | }, |
439 | 442 | state=GapicArtifact.State.LIVE, |
@@ -879,7 +882,7 @@ def test_get_experiment_model_info(self): |
879 | 882 | model_info = experiment_model.get_model_info() |
880 | 883 |
|
881 | 884 | expected_model_info = { |
882 | | - "model_class": "sklearn.linear_model._base.LinearRegression", |
| 885 | + "model_class": _LINEAR_REGRESSION_CLASS, |
883 | 886 | "framework_name": "sklearn", |
884 | 887 | "framework_version": "1.0", |
885 | 888 | "input_example": { |
|
0 commit comments