Skip to content

Tox: replace setup.py test with unittest discover #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[run]
branch = True
source =
Lib/
omit =
Lib/slapdtest.py
ldap
ldif
ldapurl
slapdtest

[paths]
source =
Expand Down
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ matrix:
- python: 3.6
env: TOXENV=doc
allow_failures:
- env:
- TOXENV=py39
- CFLAGS_std="-std=c99"
- WITH_GCOV=1
- env:
- TOXENV=pypy

Expand Down
38 changes: 22 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,49 @@ passenv = WITH_GCOV
# - 'ignore:the imp module is deprecated' is required to ignore import of 'imp'
# in distutils. Python < 3.6 use PendingDeprecationWarning; Python >= 3.6 use
# DeprecationWarning.
# - 'ignore:lib2to3 package' for Python 3.9
commands = {envpython} -bb -Werror \
"-Wignore:the imp module is deprecated:DeprecationWarning" \
"-Wignore:the imp module is deprecated:PendingDeprecationWarning" \
"-Wignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working:DeprecationWarning" \
-m coverage run --parallel setup.py \
clean --all \
test
"-Wignore:lib2to3 package is deprecated and may not be able to parse Python 3.10+:PendingDeprecationWarning" \
-m coverage run --parallel -m unittest discover -v -s Tests -p 't_*'

[testenv:py27]
# No warnings with Python 2.7
passenv = {[testenv]passenv}
commands = {envpython} \
-m coverage run --parallel setup.py test
commands =
{envpython} -m coverage run --parallel \
-m unittest discover -v -s Tests -p 't_*'

[testenv:py34]
# No warnings with Python 3.4
passenv = {[testenv]passenv}
commands = {envpython} \
-m coverage run --parallel setup.py test
commands = {[testenv:py27]commands}

[testenv:py2-nosasltls]
basepython = python2
deps = {[testenv]deps}
# don't install, install dependencies manually
skip_install = true
deps =
{[testenv]deps}
pyasn1
pyasn1_modules
passenv = {[testenv]passenv}
setenv =
CI_DISABLED=LDAPI:SASL:TLS
# rebuild without SASL and TLS, run without LDAPI
commands = {envpython} \
-m coverage run --parallel setup.py \
clean --all \
build_ext -UHAVE_SASL,HAVE_TLS \
test
# build and install without SASL and TLS, run without LDAPI
commands =
{envpython} setup.py clean --all
{envpython} setup.py build_ext -UHAVE_SASL,HAVE_TLS
{envpython} setup.py install --single-version-externally-managed --root=/
{[testenv:py27]commands}

[testenv:py3-nosasltls]
basepython = python3
deps = {[testenv]deps}
passenv = {[testenv]passenv}
skip_install = {[testenv:py2-nosasltls]skip_install}
deps = {[testenv:py2-nosasltls]deps}
passenv = {[testenv:py2-nosasltls]passenv}
setenv = {[testenv:py2-nosasltls]setenv}
commands = {[testenv:py2-nosasltls]commands}

Expand Down