summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-03-10 13:26:05 -0400
committerGitHub <noreply@github.com>2020-03-10 11:26:05 -0600
commit986f37b017134ced5d9dd38b420350916297002b (patch)
tree59fe191bbc8641a14d60f37499412912ba824443 /tools
parent71af48df3514ca831c90b77dc71ba0a121dec401 (diff)
downloadvyos-cloud-init-986f37b017134ced5d9dd38b420350916297002b.tar.gz
vyos-cloud-init-986f37b017134ced5d9dd38b420350916297002b.zip
cloudinit: move to pytest for running tests (#211)
As the nose docs[0] themselves note, it has been in maintenance mode for the past several years. pytest is an actively developed, featureful and popular alternative that the nose docs themselves recommend. See [1] for more details about the thinking here. (This PR also removes stale tox definitions, instead of modifying them.) [0] https://nose.readthedocs.io/en/latest/ [1] https://lists.launchpad.net/cloud-init/msg00245.html
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run-container12
-rwxr-xr-xtools/tox-venv2
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/run-container b/tools/run-container
index 23243474..a7a552ec 100755
--- a/tools/run-container
+++ b/tools/run-container
@@ -287,8 +287,8 @@ prep() {
install_packages "$@"
}
-nose() {
- python3 -m nose "$@"
+pytest() {
+ python3 -m pytest "$@"
}
is_done_cloudinit() {
@@ -478,10 +478,10 @@ main() {
if [ -n "$unittest" ]; then
debug 1 "running unit tests."
- run_self_inside_as_cd "$name" "$user" "$cdir" nose \
+ run_self_inside_as_cd "$name" "$user" "$cdir" pytest \
tests/unittests cloudinit/ || {
- errorrc "nosetests failed.";
- errors[${#errors[@]}]="nosetests"
+ errorrc "pytest failed.";
+ errors[${#errors[@]}]="pytest"
}
fi
@@ -557,7 +557,7 @@ main() {
}
case "${1:-}" in
- prep|os_info|wait_inside|nose) _n=$1; shift; "$_n" "$@";;
+ prep|os_info|wait_inside|pytest) _n=$1; shift; "$_n" "$@";;
*) main "$@";;
esac
diff --git a/tools/tox-venv b/tools/tox-venv
index a5d21625..9dd02460 100755
--- a/tools/tox-venv
+++ b/tools/tox-venv
@@ -116,7 +116,7 @@ Usage: ${0##*/} [--no-create] tox-environment [command [args]]
be read from tox.ini. This allows you to do:
tox-venv py27 - tests/some/sub/dir
and have the 'command' read correctly and have that execute:
- python -m nose tests/some/sub/dir
+ python -m pytest tests/some/sub/dir
EOF
if [ -f "$tox_ini" ]; then