Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit ec7d303

Browse files
authored
test: add check in pytest fixture (#1306)
1 parent c2ab0e0 commit ec7d303

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/system/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ def hierarchy_bucket_name():
150150
@pytest.fixture(scope="session")
151151
def hierarchy_bucket(storage_client, hierarchy_bucket_name, file_data):
152152
bucket = storage_client.bucket(hierarchy_bucket_name)
153-
_helpers.retry_429_503(bucket.create)()
153+
# Create the hierarchy bucket only if it doesn't yet exist.
154+
try:
155+
storage_client.get_bucket(bucket)
156+
except exceptions.NotFound:
157+
_helpers.retry_429_503(bucket.create)()
154158

155159
simple_path = _file_data["simple"]["path"]
156160
for filename in _hierarchy_filenames:

0 commit comments

Comments
 (0)