For more information on the background of the tests visit: https://www.spinics.net/lists/ceph-devel/msg34636.html
-The tests use the Nose test framework. To get started, ensure you have
+The tests use the pytest test framework. To get started, ensure you have
the ``virtualenv`` software installed; e.g. on Debian/Ubuntu::
sudo apt-get install python-virtualenv
Once you have that file copied and edited, you can run the tests with::
- RAGWEED_CONF=ragweed.conf RAGWEED_STAGES=prepare,check ./virtualenv/bin/nosetests -v
+ RAGWEED_CONF=ragweed.conf RAGWEED_STAGES=prepare,check ./virtualenv/bin/pytest -v
The phase(s) of the tests are set via ``RAGWEED_STAGES``. The options for ``RAGWEED_STAGES`` are ``prepare`` and ``check``. ``test`` can be used instead of ``check``.
Finally run the ragweed tests::
- RAGWEED_CONF=ragweed.conf RAGWEED_STAGES=prepare,check ./virtualenv/bin/nosetests -v
+ RAGWEED_CONF=ragweed.conf RAGWEED_STAGES=prepare,check ./virtualenv/bin/pytest -v
# work-around change in pip 1.5
./virtualenv/bin/pip install six
-./virtualenv/bin/pip install -I nose
+./virtualenv/bin/pip install -U pytest
./virtualenv/bin/pip install setuptools
./virtualenv/bin/pip install -U -r requirements.txt
from .reqs import _make_admin_request
+import pytest
+
ragweed_env = None
suite = None
class RTest:
- def __init__(self):
+ def setup_method(self):
self._name = self.__class__.__name__
self.r_buckets = []
self.init()
'ceph_conf is missing under the [rados] section in ' + os.environ['RAGWEED_CONF']
)
+ print('conf=' + str(self.ceph_conf))
self.rados = rados.Rados(conffile=self.ceph_conf)
self.rados.connect()
ragweed_env = RagweedEnv()
suite = ragweed_env.suite
+
+@pytest.fixture(scope="package", autouse=True)
+def setup_teardown():
+ setup_module()
+ yield