]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: s/yield_fixture/fixture/ 38919/head
authorKefu Chai <kchai@redhat.com>
Fri, 15 Jan 2021 01:27:26 +0000 (09:27 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Jan 2021 01:37:39 +0000 (09:37 +0800)
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 <kchai@redhat.com>
src/pybind/mgr/cephadm/tests/fixtures.py

index e03d01d54693dbaddfe2daf8211ceaafa0b5278e..5c14aee1de411fc06da949caa572d75345642633 100644 (file)
@@ -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())