Skip to content

Commit 4a2a21b

Browse files
committed
Tweak safe cleanup syntax
1 parent 48dd2cb commit 4a2a21b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/integration/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# License https://www.backblaze.com/using_b2_code.html
88
#
99
######################################################################
10+
11+
import contextlib
1012
import sys
1113

1214
from os import environ, path
@@ -53,10 +55,8 @@ def realm() -> str:
5355
def bucket_name(b2_api) -> str:
5456
bucket = b2_api.create_bucket()
5557
yield bucket.name
56-
try:
58+
with contextlib.suppress(BucketIdNotFound):
5759
b2_api.clean_bucket(bucket)
58-
except BucketIdNotFound:
59-
pass
6060

6161

6262
@pytest.fixture(scope='function') # , autouse=True)

0 commit comments

Comments
 (0)