Skip to content

Commit 2d24606

Browse files
authored
test: fix blob snippets tests gcs folder wipeout (#2044)
1 parent 6370d3b commit 2d24606

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

samples/snippets/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ def gcs_bucket(storage_client: storage.Client) -> Generator[str, None, None]:
6363
blob.delete()
6464

6565

66+
@pytest.fixture(scope="session")
67+
def gcs_bucket_snippets(storage_client: storage.Client) -> Generator[str, None, None]:
68+
bucket_name = "bigframes_blob_test_snippet_with_data_wipeout"
69+
70+
yield bucket_name
71+
72+
bucket = storage_client.get_bucket(bucket_name)
73+
for blob in bucket.list_blobs():
74+
blob.delete()
75+
76+
6677
@pytest.fixture(autouse=True)
6778
def reset_session() -> None:
6879
"""An autouse fixture ensuring each sample runs in a fresh session.

samples/snippets/multimodal_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# limitations under the License.
1414

1515

16-
def test_multimodal_dataframe(gcs_bucket: str) -> None:
16+
def test_multimodal_dataframe(gcs_bucket_snippets: str) -> None:
1717
# destination folder must be in a GCS bucket that the BQ connection service account (default or user provided) has write access to.
18-
dst_bucket = f"gs://{gcs_bucket}"
18+
dst_bucket = f"gs://{gcs_bucket_snippets}"
1919
# [START bigquery_dataframes_multimodal_dataframe_create]
2020
import bigframes
2121

0 commit comments

Comments
 (0)