From: Kefu Chai Date: Fri, 15 Jan 2021 01:27:26 +0000 (+0800) Subject: mgr/cephadm: s/yield_fixture/fixture/ X-Git-Tag: v16.1.0~29^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=87af6d1f8110204163c9142dda8a82cd73d6cf6d;p=ceph.git 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 --- diff --git a/src/pybind/mgr/cephadm/tests/fixtures.py b/src/pybind/mgr/cephadm/tests/fixtures.py index e03d01d54693..5c14aee1de41 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())