1313# limitations under the License.
1414
1515import os
16+ from typing import Tuple
1617import uuid
1718
1819import backoff
3031
3132
3233@pytest .fixture (scope = "module" )
33- def hmac_fixture ():
34+ def hmac_fixture () -> Tuple [ storage . hmac_key . HMACKeyMetadata , str ] :
3435 """
3536 Creates an HMAC Key and secret to supply to the S3 SDK tests. The key
3637 will be deleted after the test session.
@@ -45,7 +46,7 @@ def hmac_fixture():
4546
4647
4748@pytest .fixture (scope = "module" )
48- def test_bucket ():
49+ def test_bucket () -> storage . Bucket :
4950 """Yields a bucket that is deleted after the test completes."""
5051 bucket = None
5152 while bucket is None or bucket .exists ():
@@ -57,7 +58,7 @@ def test_bucket():
5758
5859
5960@pytest .fixture (scope = "module" )
60- def test_blob (test_bucket ) :
61+ def test_blob (test_bucket : storage . Bucket ) -> storage . Blob :
6162 """Yields a blob that is deleted after the test completes."""
6263 bucket = test_bucket
6364 blob = bucket .blob (f"storage_snippets_test_sigil-{ uuid .uuid4 ()} " )
@@ -68,18 +69,20 @@ def test_blob(test_bucket):
6869# Retry request because the created key may not be fully propagated for up
6970# to 15s.
7071@backoff .on_exception (backoff .constant , ClientError , interval = 1 , max_time = 15 )
71- def test_list_buckets (hmac_fixture , test_bucket ) :
72- results = list_gcs_buckets .list_gcs_buckets (
72+ def test_list_buckets (hmac_fixture : Tuple [ storage . hmac_key . HMACKeyMetadata , str ], test_bucket : storage . Bucket ) -> None :
73+ result = list_gcs_buckets .list_gcs_buckets (
7374 google_access_key_id = hmac_fixture [0 ].access_id ,
7475 google_access_key_secret = hmac_fixture [1 ],
7576 )
76- assert test_bucket .name in results
77+ assert test_bucket .name in result
7778
7879
7980# Retry request because the created key may not be fully propagated for up
8081# to 15s.
8182@backoff .on_exception (backoff .constant , ClientError , interval = 1 , max_time = 15 )
82- def test_list_blobs (hmac_fixture , test_bucket , test_blob ):
83+ def test_list_blobs (
84+ hmac_fixture : Tuple [storage .hmac_key .HMACKeyMetadata , str ], test_bucket : storage .Bucket , test_blob : storage .Blob
85+ ) -> None :
8386 result = list_gcs_objects .list_gcs_objects (
8487 google_access_key_id = hmac_fixture [0 ].access_id ,
8588 google_access_key_secret = hmac_fixture [1 ],
0 commit comments