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>
class TestPgAutoscaler(object):
- def setup(self):
+ def setup_method(self):
# a bunch of attributes for testing.
self.autoscaler = module.PgAutoscaler('module_name', 0, 0)
class TestPgAutoscaler(object):
- def setup(self):
+ def setup_method(self):
# a bunch of attributes for testing.
self.autoscaler = module.PgAutoscaler('module_name', 0, 0)
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
class TestModule(object):
# Testing Module Class
- def setup(self):
+ def setup_method(self):
# Creating the class and Mocking a
# bunch of attributes for testing