From 5503f2b68698546981c51915674c9b315ce90d8f Mon Sep 17 00:00:00 2001 From: Morgan Du Date: Mon, 7 Feb 2022 08:20:30 -0800 Subject: [PATCH] fix: rename teardown fixture --- tests/system/aiplatform/e2e_base.py | 4 +++- tests/system/aiplatform/test_e2e_tabular.py | 2 +- tests/system/aiplatform/test_model_upload.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/system/aiplatform/e2e_base.py b/tests/system/aiplatform/e2e_base.py index 3a9f87e8ae..30885339eb 100644 --- a/tests/system/aiplatform/e2e_base.py +++ b/tests/system/aiplatform/e2e_base.py @@ -124,11 +124,13 @@ def delete_bigquery_dataset(self, shared_state: Dict[str, Any]): ) # Make an API request. @pytest.fixture(scope="class", autouse=True) - def teardown(self, shared_state: Dict[str, Any]): + def tear_down_resources(self, shared_state: Dict[str, Any]): """Delete every Vertex AI resource created during test""" yield + # TODO(b/218310362): Add resource deletion system tests + # Bring all Endpoints to the front of the list # Ensures Models are undeployed first before we attempt deletion shared_state["resources"].sort( diff --git a/tests/system/aiplatform/test_e2e_tabular.py b/tests/system/aiplatform/test_e2e_tabular.py index 5e7b416a8c..3fcae149c3 100644 --- a/tests/system/aiplatform/test_e2e_tabular.py +++ b/tests/system/aiplatform/test_e2e_tabular.py @@ -46,7 +46,7 @@ } -@pytest.mark.usefixtures("prepare_staging_bucket", "delete_staging_bucket", "teardown") +@pytest.mark.usefixtures("prepare_staging_bucket", "delete_staging_bucket") class TestEndToEndTabular(e2e_base.TestEndToEnd): """End to end system test of the Vertex SDK with tabular data adapted from reference notebook http://shortn/_eyoNx3SN0X""" diff --git a/tests/system/aiplatform/test_model_upload.py b/tests/system/aiplatform/test_model_upload.py index 70f78aec60..76fe679021 100644 --- a/tests/system/aiplatform/test_model_upload.py +++ b/tests/system/aiplatform/test_model_upload.py @@ -32,7 +32,7 @@ _XGBOOST_MODEL_URI = "gs://cloud-samples-data-us-central1/vertex-ai/google-cloud-aiplatform-ci-artifacts/models/iris_xgboost/model.bst" -@pytest.mark.usefixtures("delete_staging_bucket", "teardown") +@pytest.mark.usefixtures("delete_staging_bucket") class TestModel(e2e_base.TestEndToEnd): _temp_prefix = f"{_TEST_PROJECT}-vertex-staging-{_TEST_LOCATION}"