]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: s/setup(self)/setup_method(self)/
authorKefu Chai <tchaikov@gmail.com>
Sun, 18 Dec 2022 12:16:02 +0000 (20:16 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sun, 18 Dec 2022 12:23:47 +0000 (20:23 +0800)
avoid pytest warnings like:

4: pg_autoscaler/tests/test_cal_final_pg_target.py::TestPgAutoscaler::test_even_pools_one_meta_three_bulk
4:   /home/kefu/dev/ceph/src/pybind/mgr/.tox/py3/lib/python3.10/site-packages/_pytest/fixtures.py:900: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
4:   pg_autoscaler/tests/test_cal_final_pg_target.py::TestPgAutoscaler::test_even_pools_one_meta_three_bulk is using nose-specific method: `setup(self)`
4:   To remove this warning, rename it to `setup_method(self)`
4:   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
4:     fixture_result = next(generator)

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/pybind/mgr/pg_autoscaler/tests/test_cal_final_pg_target.py
src/pybind/mgr/pg_autoscaler/tests/test_overlapping_roots.py
src/pybind/mgr/progress/test_progress.py

index d8ba83d111af42a63ec2377040055ba32a6bc34d..655025bbef877498fd69b2dfea8c10a6c40c14bc 100644 (file)
@@ -18,7 +18,7 @@ class RootMapItem:
 
 class TestPgAutoscaler(object):
 
-    def setup(self):
+    def setup_method(self):
         # a bunch of attributes for testing.
         self.autoscaler = module.PgAutoscaler('module_name', 0, 0)
 
index bf4ddfb62020d012740bc865f017f01fd2f599fd..009019707ec84608acebe0118561c0bcc07f4d6d 100644 (file)
@@ -42,7 +42,7 @@ class CRUSH:
 
 class TestPgAutoscaler(object):
 
-    def setup(self):
+    def setup_method(self):
         # a bunch of attributes for testing.
         self.autoscaler = module.PgAutoscaler('module_name', 0, 0)
 
index ef4e7e166180571faf51bda6ff191e3e238cea94..47baa177e25b7b59cbb5b7da71ec4e9b297de6d0 100644 (file)
@@ -13,7 +13,7 @@ from progress import module
 class TestPgRecoveryEvent(object):
     # Testing PgRecoveryEvent class
 
-    def setup(self):
+    def setup_method(self):
         # Creating the class and Mocking 
         # a bunch of attributes for testing
         module._module = mock.Mock() # just so Event._refresh() works
@@ -90,7 +90,7 @@ class OSDMap:
 class TestModule(object):
     # Testing Module Class
     
-    def setup(self):
+    def setup_method(self):
         # Creating the class and Mocking a
         # bunch of attributes for testing