From b80bfd6dd843ef3f6ddaa27d52e5b47342bca64e Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Sat, 28 Nov 2020 14:49:47 +0100 Subject: [PATCH] Unify usage of return and yield --- tests/fixtures/device.py | 4 ++-- tests/fixtures/protobuf.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/fixtures/device.py b/tests/fixtures/device.py index 83a1d75..c7f9ab8 100644 --- a/tests/fixtures/device.py +++ b/tests/fixtures/device.py @@ -14,7 +14,7 @@ def mock_device(request): device._info = deepcopy(request.cls.device_info) device._session = None device._zeroconf = None - yield device + return device @pytest.fixture() @@ -26,4 +26,4 @@ def mock_service_browser(mocker): @pytest.fixture() def mock_zeroconf(mocker): mocker.patch("zeroconf.Zeroconf.get_service_info", MockZeroconf.get_service_info) - yield Zeroconf() + return Zeroconf() diff --git a/tests/fixtures/protobuf.py b/tests/fixtures/protobuf.py index 7da8c6a..3b19622 100644 --- a/tests/fixtures/protobuf.py +++ b/tests/fixtures/protobuf.py @@ -10,8 +10,7 @@ @pytest.fixture() def mock_protobuf(): - protobuf = StubProtobuf() - yield protobuf + return StubProtobuf() @pytest.fixture()