8000 Fix: replace pytest.yield_fixture with pytest.fixture (#8238) · sreza/python-docs-samples@16e40ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 16e40ce

Browse files
authored
Fix: replace pytest.yield_fixture with pytest.fixture (GoogleCloudPlatform#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.
1 parent b6b144f commit 16e40ce

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

appengine/standard/appengine_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def run_taskqueue_tasks(testbed, app):
118118

119119
# py.test helpers
120120

121-
@pytest.yield_fixture
121+
@pytest.fixture
122122
def testbed():
123123
"""py.test fixture for the GAE testbed."""
124124
testbed = setup_testbed()

datastore/cloud-client/snippets_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def cleanup(self):
3636
)
3737

3838

39-
@pytest.yield_fixture
39+
@pytest.fixture
4040
def client():
4141
client = CleanupClient(PROJECT)
4242
yield client

datastore/cloud-client/tasks_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
PROJECT = os.environ["GOOGLE_CLOUD_PROJECT"]
2424

2525

26-
@pytest.yield_fixture
26+
@pytest.fixture
2727
def client():
2828
# We use namespace for isolating builds.
2929
namespace = uuid.uuid4().hex

dns/api/main_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2015, Google, Inc.
1+
# Copyright 2015 Google, Inc.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -33,7 +33,7 @@ def delay_rerun(*args):
3333
return True
3434

3535

36-
@pytest.yield_fixture
36+
@pytest.fixture
3737
def client():
3838
client = dns.Client(PROJECT)
3939

@@ -47,7 +47,7 @@ def client():
4747
5D08 pass
4848

4949

50-
@pytest.yield_fixture
50+
@pytest.fixture
5151
def zone(client):
5252
zone = client.zone(TEST_ZONE_NAME, TEST_ZONE_DNS_NAME)
5353
zone.description = TEST_ZONE_DESCRIPTION

0 commit comments

Comments
 (0)
0