Switch from nose to pytest (#5282)

* Use pipstrap to install a good version of pip

* Use pytest in cb-auto tests

* Remove nose usage in auto_test.py

* remove nose dev dep

* use pytest in test_tests

* Use pytest in tox

* Update dev dependency pinnings

* remove nose multiprocess lines

* Use pytest for coverage

* Use older py and pytest for old python versions

* Add test for Error.__str__

* pin pytest in oldest test

* Fix tests for DNS-DO plugin on py26

* Work around bug for Python 3.3

* Clarify dockerfile comments
This commit is contained in:
Brad Warren
2017-12-01 10:59:55 -08:00
committed by GitHub
parent d246ba78c7
commit 48173ed1cb
25 changed files with 74 additions and 79 deletions
+5 -1
View File
@@ -16,6 +16,10 @@ for requirement in "$@" ; do
pkg=$(echo $requirement | cut -f1 -d\[) # remove any extras such as [dev]
if [ $pkg = "." ]; then
pkg="certbot"
else
# Work around a bug in pytest/importlib for the deprecated Python 3.3.
# See https://travis-ci.org/certbot/certbot/jobs/308774157#L1333.
pkg=$(echo "$pkg" | tr - _)
fi
nosetests -v $pkg --processes=-1 --process-timeout=100
pytest --numprocesses auto --quiet --pyargs $pkg
done
+6 -1
View File
@@ -4,6 +4,7 @@
# invocation, some constraints may be ignored due to pip's lack of dependency
# resolution.
alabaster==0.7.10
apipkg==1.4
astroid==1.3.5
Babel==2.5.1
backports.shutil-get-terminal-size==1.0.0
@@ -15,6 +16,7 @@ decorator==4.1.2
dns-lexicon[dnsmadeeasy]==2.1.11
dnspython==1.15.0
docutils==0.14
execnet==1.5.0
future==0.16.0
futures==3.1.1
google-api-python-client==1.6.4
@@ -27,7 +29,6 @@ Jinja2==2.9.6
jmespath==0.9.3
logilab-common==1.4.1
MarkupSafe==1.0
nose==1.3.7
oauth2client==4.1.2
pathlib2==2.3.0
pexpect==4.2.1
@@ -42,6 +43,10 @@ pyasn1==0.3.7
pyasn1-modules==0.1.5
Pygments==2.2.0
pylint==1.4.2
pytest==3.2.5
pytest-cov==2.5.1
pytest-forked==0.2
pytest-xdist==1.20.1
python-dateutil==2.6.1
python-digitalocean==1.12
PyYAML==3.12
+3 -3
View File
@@ -55,7 +55,7 @@ SUBPKGS="$SUBPKGS_IN_AUTO $SUBPKGS_NOT_IN_AUTO"
subpkgs_modules="$(echo $SUBPKGS | sed s/-/_/g)"
# certbot_compatibility_test is not packaged because:
# - it is not meant to be used by anyone else than Certbot devs
# - it causes problems when running nosetests - the latter tries to
# - it causes problems when running pytest - the latter tries to
# run everything that matches test*, while there are no unittests
# there
@@ -166,10 +166,10 @@ fi
mkdir kgs
kgs="kgs/$version"
pip freeze | tee $kgs
pip install nose
pip install pytest
for module in $subpkgs_modules ; do
echo testing $module
nosetests $module
pytest --pyargs $module
done
cd ~-