646012c26db9335f69216c5d8656090c4211f323,storage/cloud-client/bucket_lock_test.py,,bucket,#,40

Before Change


def bucket():
    Creates a test bucket and deletes it upon completion.
    client = storage.Client()
    bucket_name = "bucket-lock-" + str(int(time.time()))
    bucket = client.create_bucket(bucket_name)
    yield bucket
    bucket.delete(force=True)

After Change


    Yields a bucket that is deleted after the test completes.
    bucket = None
    while bucket is None or bucket.exists():
        bucket_name = "bucket-lock-{}".format(uuid.uuid4())
        bucket = storage.Client().bucket(bucket_name)
    bucket.create()
    yield bucket
    bucket.delete(force=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 646012c26db9335f69216c5d8656090c4211f323
Time: 2020-03-05
Author: crwilcox@google.com
File Name: storage/cloud-client/bucket_lock_test.py
Class Name:
Method Name: bucket


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6c7f63e58534ff60c524324a1cf8628c838df772
Time: 2020-03-05
Author: crwilcox@google.com
File Name: storage/cloud-client/iam_test.py
Class Name:
Method Name: bucket


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7029fcc6ff92856d43119a56b9d3367ae0fd7b55
Time: 2020-04-21
Author: tmatsuo@google.com
File Name: container_registry/container_analysis/samples_test.py
Class Name: TestContainerAnalysisSamples
Method Name: setup_method