]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/dashboard: use setUpClass for initializeing class
authorKefu Chai <kchai@redhat.com>
Fri, 16 Oct 2020 17:10:24 +0000 (01:10 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 20 Oct 2020 11:13:12 +0000 (19:13 +0800)
commit71979e9b46e21dc3d3cfc6f06f4a84c9b4c7ce78
tree042c1debcadc2fcbb8161bcd6b7faff1b94c0306
parent34da2a118517ef5031795f3d73fc80877e50599d
pybind/mgr/dashboard: use setUpClass for initializeing class

instead of relying on __init__(), use setUpClass() to initialize class
for testing. it turns out in pytest > 4, __init__() is called for the
test class but the attributes of the instantiated class is in turn overriden.

so we have to use setUpClass to do this job.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/dashboard/tests/__init__.py
src/pybind/mgr/dashboard/tests/test_api_auditing.py
src/pybind/mgr/dashboard/tests/test_settings.py
src/pybind/mgr/dashboard/tests/test_tools.py