Replace nose by pytest 14/73914/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 14 Mar 2023 10:05:18 +0000 (11:05 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 14 Mar 2023 16:29:37 +0000 (17:29 +0100)
Change-Id: If4b8feac021fb2fe5994a6b6bd1e36d302cb8b88
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
requirements.txt
test-requirements.txt
tox.ini
upper-constraints.txt

index cb74132..23fc58e 100644 (file)
@@ -19,3 +19,4 @@ ruamel.yaml.jinja2 # MIT
 tempest # Apache-2.0
 rally
 rally-openstack
+munch  # MIT
index e3cf977..a552f60 100644 (file)
@@ -3,7 +3,9 @@
 # process, which may cause wedges in the gate later.
 coverage!=4.4 # Apache-2.0
 mock!=4.0.0,!=4.0.1 # BSD
-nose # LGPL
+pytest  # MIT
+pytest-html  #MPL-2.0
+pytest-cov
 flake8 # MIT
 pylint # GPLv2
 sphinx!=1.6.6,!=1.6.7,!=2.1.0,!=3.0.0,!=3.4.2 # BSD
diff --git a/tox.ini b/tox.ini
index 71e8c1b..b3e5146 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -10,13 +10,12 @@ deps =
   -r{toxinidir}/requirements.txt
   -r{toxinidir}/test-requirements.txt
 install_command = pip install {opts} {packages}
-commands = nosetests --with-xunit \
-  --with-coverage \
-  --cover-tests \
-  --cover-package=functest \
-  --cover-xml \
-  --cover-html \
-  functest/tests/unit
+commands =
+  pytest \
+    --junit-xml=junit.xml \
+    --html=report.html --self-contained-html \
+    --cov=xtesting --cov-reset --cov-report html \
+    functest/tests/unit
 
 [testenv:docs]
 basepython = python3.10
@@ -41,6 +40,7 @@ basepython = python3.10
 commands =
   pylint \
     --ignore-imports=y --min-similarity-lines=15 \
+    --generated-members=os.* \
     --disable=locally-disabled functest
 
 [testenv:yamllint]
@@ -57,9 +57,6 @@ files =
 commands =
   yamllint -s {[testenv:yamllint]files}
 
-[testenv:py37]
-commands = nosetests functest/tests/unit
-
 [testenv:bashate]
 basepython = python3.10
 files =
@@ -71,7 +68,6 @@ files =
   build.sh
 commands = bashate -e E005,E006,E042,E043 {[testenv:bashate]files}
 
-
 [testenv:bandit]
 basepython = python3.10
 commands = bandit -r functest -x tests -n 5 -ll -s B601,B602
@@ -82,12 +78,9 @@ dirs =
   functest/tests/unit/odl
   functest/tests/unit/openstack/vping
   functest/tests/unit/openstack/cinder
-commands = nosetests --with-coverage --cover-tests \
-  --cover-package functest.opnfv_tests.sdn.odl \
-  --cover-package functest.opnfv_tests.openstack.vping.vping_ssh \
-  --cover-package functest.opnfv_tests.openstack.cinder.cinder_test \
-  --cover-package functest.tests.unit \
-  --cover-min-percentage 100 {[testenv:cover]dirs}
+commands =
+  pytest --cov=xtesting --cov-reset --cov-report html --cov-fail-under=100 \
+    {[testenv:cover]dirs}
 
 [testenv:perm]
 basepython = python3.10
index 0df00ed..bddb333 100644 (file)
@@ -14,7 +14,9 @@ git+https://opendev.org/openstack/rally-openstack.git#egg=rally-openstack
 git+https://github.com/xrally/xrally-kubernetes.git#egg=xrally-kubernetes
 pylint===2.11.1
 flake8===4.0.1
-nose===1.3.7
+pytest===7.1.2
+pytest-cov===3.0.0
+pytest-html===3.1.1
 ruamel.yaml===0.17.17
 sphinxcontrib-spelling===4.3.0
 ansible-lint===5.2.1