diff options
| author | Simon <965089+sarthurdev@users.noreply.github.com> | 2025-09-18 16:45:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-18 16:45:59 +0200 |
| commit | 94912576d4012cc28825e2933768b362ba512b89 (patch) | |
| tree | da82eede37ab044fff4e0b63894df9fa4b5e2c5c | |
| parent | f8ecb5136beba589cb01d241b09b1832a00b0e0d (diff) | |
| parent | 45ac29070e1a95cc1bcb090fd3a58692ff755b2b (diff) | |
| download | vyos-1x-94912576d4012cc28825e2933768b362ba512b89.tar.gz vyos-1x-94912576d4012cc28825e2933768b362ba512b89.zip | |
Merge pull request #4728 from sarthurdev/T7825
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 |
