Skip to content

Commit 45ac290

Browse files
committed
nose: T7825: Use nose2 for unit tests
1 parent 69d0a74 commit 45ac290

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ clean:
101101
.PHONY: test
102102
test: generate-configd-include-json
103103
set -e; python3 -m compileall -q -x '/vmware-tools/scripts/' .
104-
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
104+
PYTHONPATH=python/ python3 -m nose2 -v
105105

106106
.PHONY: check_migration_scripts_executable
107107
.ONESHELL:

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Build-Depends:
3434
python3-hurry.filesize,
3535
python3-netaddr,
3636
python3-netifaces,
37-
python3-nose,
37+
python3-nose2,
3838
python3-jinja2,
3939
python3-paramiko,
4040
python3-passlib,

nose2.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[unittest]
2+
start-dir = src
3+
code-directories = conf_mode
4+
op_mode
5+
completion
6+
validators
7+
tests
8+
test-file-pattern = test_*.py
9+
test-method-prefix = test

python/vyos/airbag.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525

2626
def enable(log=True):
27+
if 'nose2' in sys.modules:
28+
return
2729
if log:
2830
_intercepting_logger()
2931
_intercepting_exceptions()

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python/
22
lxml
33
pylint
4-
nose
4+
nose2
55
coverage
66
jinja2

0 commit comments

Comments
 (0)