Skip to content

Commit f625a1b

Browse files
committed
Tox: replace setup.py test with unittest discover
setup.py test is deprecated and causes issues with testing our code. There are cases where the wrong shared library is picked up. The ``unittest discover`` approach avoids building the extension twice. python-ldap should move to pytest eventually. Fixes: #326 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 7e084ae commit f625a1b

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

tox.ini

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,43 @@ commands = {envpython} -bb -Werror \
2020
"-Wignore:the imp module is deprecated:DeprecationWarning" \
2121
"-Wignore:the imp module is deprecated:PendingDeprecationWarning" \
2222
"-Wignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working:DeprecationWarning" \
23-
-m coverage run --parallel setup.py \
24-
clean --all \
25-
test
23+
-m coverage run --parallel -m unittest discover -s Tests -p 't_*'
2624

2725
[testenv:py27]
2826
# No warnings with Python 2.7
2927
passenv = {[testenv]passenv}
30-
commands = {envpython} \
31-
-m coverage run --parallel setup.py test
28+
commands =
29+
{envpython} -m coverage run --parallel \
30+
-m unittest discover -s Tests -p 't_*'
3231

3332
[testenv:py34]
3433
# No warnings with Python 3.4
3534
passenv = {[testenv]passenv}
36-
commands = {envpython} \
37-
-m coverage run --parallel setup.py test
35+
commands = {[testenv:py27]commands}
3836

3937
[testenv:py2-nosasltls]
4038
basepython = python2
41-
deps = {[testenv]deps}
39+
# don't install, install dependencies manually
40+
skip_install = true
41+
deps =
42+
{[testenv]deps}
43+
pyasn1
44+
pyasn1_modules
4245
passenv = {[testenv]passenv}
4346
setenv =
4447
CI_DISABLED=LDAPI:SASL:TLS
45-
# rebuild without SASL and TLS, run without LDAPI
46-
commands = {envpython} \
47-
-m coverage run --parallel setup.py \
48-
clean --all \
49-
build_ext -UHAVE_SASL,HAVE_TLS \
50-
test
48+
# build and install without SASL and TLS, run without LDAPI
49+
commands =
50+
{envpython} setup.py clean --all
51+
{envpython} setup.py build_ext -UHAVE_SASL,HAVE_TLS
52+
{envpython} setup.py install --single-version-externally-managed --root=/
53+
{[testenv:py27]commands}
5154

5255
[testenv:py3-nosasltls]
5356
basepython = python3
54-
deps = {[testenv]deps}
55-
passenv = {[testenv]passenv}
57+
skip_install = {[testenv:py2-nosasltls]skip_install}
58+
deps = {[testenv:py2-nosasltls]deps}
59+
passenv = {[testenv:py2-nosasltls]passenv}
5660
setenv = {[testenv:py2-nosasltls]setenv}
5761
commands = {[testenv:py2-nosasltls]commands}
5862

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy