Skip to content

Commit

Permalink
Fix: replace pytest.yield_fixture with pytest.fixture (GoogleCloudPla…
Browse files Browse the repository at this point in the history
…tform#8238)

## Description

Replace the deprecated `pytest.yield_fixture` with `pytest.fixture`

Fixes GoogleCloudPlatform#8232

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

## Checklist
- [x] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md)
- [x] **Tests** pass:   `nox -s py-3.9` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup))
- [x] **Lint** pass:   `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup))
- [x] Please **merge** this PR for me once it is approved.
  • Loading branch information
Mariatta authored Aug 9, 2022
1 parent b6b144f commit 16e40ce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion appengine/standard/appengine_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def run_taskqueue_tasks(testbed, app):

# py.test helpers

@pytest.yield_fixture
@pytest.fixture
def testbed():
"""py.test fixture for the GAE testbed."""
testbed = setup_testbed()
Expand Down
2 changes: 1 addition & 1 deletion datastore/cloud-client/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def cleanup(self):
)


@pytest.yield_fixture
@pytest.fixture
def client():
client = CleanupClient(PROJECT)
yield client
Expand Down
2 changes: 1 addition & 1 deletion datastore/cloud-client/tasks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
PROJECT = os.environ["GOOGLE_CLOUD_PROJECT"]


@pytest.yield_fixture
@pytest.fixture
def client():
# We use namespace for isolating builds.
namespace = uuid.uuid4().hex
Expand Down
6 changes: 3 additions & 3 deletions dns/api/main_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015, Google, Inc.
# Copyright 2015 Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -33,7 +33,7 @@ def delay_rerun(*args):
return True


@pytest.yield_fixture
@pytest.fixture
def client():
client = dns.Client(PROJECT)

Expand All @@ -47,7 +47,7 @@ def client():
pass


@pytest.yield_fixture
@pytest.fixture
def zone(client):
zone = client.zone(TEST_ZONE_NAME, TEST_ZONE_DNS_NAME)
zone.description = TEST_ZONE_DESCRIPTION
Expand Down

0 comments on commit 16e40ce

Please sign in to comment.