diff options
| author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2025-06-23 20:08:37 +0200 |
|---|---|---|
| committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2025-09-18 16:44:26 +0200 |
| commit | 45ac29070e1a95cc1bcb090fd3a58692ff755b2b (patch) | |
| tree | 401c4e1a2a4ab58c72c79f724c63e4e3e9c60f02 | |
| parent | 69d0a7499f4990c33c8d186763288dae7d2756a6 (diff) | |
| download | vyos-1x-45ac29070e1a95cc1bcb090fd3a58692ff755b2b.tar.gz vyos-1x-45ac29070e1a95cc1bcb090fd3a58692ff755b2b.zip | |
nose: T7825: Use nose2 for unit tests
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | debian/control | 2 | ||||
| -rw-r--r-- | nose2.cfg | 9 | ||||
| -rw-r--r-- | python/vyos/airbag.py | 2 | ||||
| -rw-r--r-- | test-requirements.txt | 2 |
5 files changed, 14 insertions, 3 deletions
@@ -101,7 +101,7 @@ clean: .PHONY: test test: generate-configd-include-json set -e; python3 -m compileall -q -x '/vmware-tools/scripts/' . - PYTHONPATH=python/ python3 -m "nose" --with-xunit src --with-coverage --cover-erase --cover-xml --cover-package src/conf_mode,src/op_mode,src/completion,src/helpers,src/validators,src/tests --verbose + PYTHONPATH=python/ python3 -m nose2 -v .PHONY: check_migration_scripts_executable .ONESHELL: diff --git a/debian/control b/debian/control index dc7b1f0a0..c2eb009a6 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,7 @@ Build-Depends: python3-hurry.filesize, python3-netaddr, python3-netifaces, - python3-nose, + python3-nose2, python3-jinja2, python3-paramiko, python3-passlib, diff --git a/nose2.cfg b/nose2.cfg new file mode 100644 index 000000000..e2fbd610a --- /dev/null +++ b/nose2.cfg @@ -0,0 +1,9 @@ +[unittest] +start-dir = src +code-directories = conf_mode + op_mode + completion + validators + tests +test-file-pattern = test_*.py +test-method-prefix = test diff --git a/python/vyos/airbag.py b/python/vyos/airbag.py index 1dcccdd47..bba8fc9fd 100644 --- a/python/vyos/airbag.py +++ b/python/vyos/airbag.py @@ -24,6 +24,8 @@ from vyos.defaults import airbag_noteworthy_size def enable(log=True): + if 'nose2' in sys.modules: + return if log: _intercepting_logger() _intercepting_exceptions() diff --git a/test-requirements.txt b/test-requirements.txt index a475e0a16..10f52300e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ python/ lxml pylint -nose +nose2 coverage jinja2 |
