From 87af6d1f8110204163c9142dda8a82cd73d6cf6d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 15 Jan 2021 09:27:26 +0800 Subject: [PATCH] mgr/cephadm: s/yield_fixture/fixture/ silences pytest warning. it complained:` 1: cephadm/tests/fixtures.py:68 1: /var/ssd/ceph/src/pybind/mgr/cephadm/tests/fixtures.py:68: PytestDeprecationWarning: @pytest.yield_fixture is deprecated. 1: Use @pytest.fixture instead; they are the same. 1: @pytest.yield_fixture() Signed-off-by: Kefu Chai --- src/pybind/mgr/cephadm/tests/fixtures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/cephadm/tests/fixtures.py b/src/pybind/mgr/cephadm/tests/fixtures.py index e03d01d54693d..5c14aee1de411 100644 --- a/src/pybind/mgr/cephadm/tests/fixtures.py +++ b/src/pybind/mgr/cephadm/tests/fixtures.py @@ -65,13 +65,13 @@ def with_cephadm_module(module_options=None, store=None): yield m -@pytest.yield_fixture() +@pytest.fixture() def cephadm_module(): with with_cephadm_module({}) as m: yield m -@pytest.yield_fixture() +@pytest.fixture() def rm_util(): with with_cephadm_module({}) as m: r = RemoveUtil.__new__(RemoveUtil) @@ -79,7 +79,7 @@ def rm_util(): yield r -@pytest.yield_fixture() +@pytest.fixture() def osd_obj(): with mock.patch("cephadm.services.osd.RemoveUtil"): o = OSD(0, mock.MagicMock()) -- 2.39.5