[Freeipa-devel] [freeipa PR#374][comment] pytest: set rules to find test files and functions

tiran freeipa-github-notification at redhat.com
Fri Jan 6 17:54:22 UTC 2017


  URL: https://github.com/freeipa/freeipa/pull/374
Title: #374: pytest: set rules to find test files and functions

tiran commented:
"""
Reproducer:

* clone my tox branch https://github.com/tiran/freeipa/tree/tox
* run ```tox -e py27```

```
$ tox -e py27
py27 create: /home/heimes/redhat/freeipa/.tox/py27
py27 installdeps: ipaclient, ipatests
['/home/heimes/redhat/freeipa/.tox-install.sh', '/home/heimes/redhat/freeipa/.tox/py27/bin/python', '/home/heimes/redhat/freeipa/.tox/py27/lib/python2.7/site-packages', 'ipaclient', 'ipatests']
py27 installed: cffi==1.9.1,configparser==3.5.0,cryptography==1.7.1,custodia==0.2.0,decorator==4.0.10,dnspython==1.15.0,enum34==1.1.6,gssapi==1.2.0,idna==2.2,ipaclient==4.4.90.dev201701051932+gitadb0120,ipaddress==1.0.17,ipalib==4.4.90.dev201701051932+gitadb0120,ipapython==4.4.90.dev201701051932+gitadb0120,ipatests==4.4.90.dev201701051932+gitadb0120,jwcrypto==0.4.0,netaddr==0.7.18,netifaces==0.10.5,nose==1.3.7,polib==1.0.8,py==1.4.32,pyasn1==0.1.9,pyasn1-modules==0.0.8,pycparser==2.17,pyldap==2.4.25.1,pytest==3.0.5,pytest-multihost==1.1,python-nss==1.0.1,python-yubico==1.3.2,pyusb==1.0.0,qrcode==5.3,requests==2.12.4,six==1.10.0
py27 runtests: PYTHONHASHSEED='3237466879'
py27 runtests: commands[0] | ipa-run-tests test_ipapython test_ipalib test_pkcs10 --ignore=test_ipalib/test_rpc.py
=================================================================== test session starts ====================================================================
platform linux2 -- Python 2.7.12, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir: /home/heimes/redhat, inifile: tox.ini
plugins: multihost-1.1
collected 0 items 

=============================================================== no tests ran in 0.12 seconds ===============================================================
ERROR: InvocationError: '/home/heimes/redhat/freeipa/.tox/py27/bin/ipa-run-tests test_ipapython test_ipalib test_pkcs10 --ignore=test_ipalib/test_rpc.py'
_________________________________________________________________________ summary __________________________________________________________________________
ERROR:   py27: commands failed
```

* edit ```ipatests/conftest.py``` and enable ```python_files``` on line 47
* run ```tox -e py27``` again

```
=================================================================== test session starts ====================================================================
platform linux2 -- Python 2.7.12, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir: /home/heimes/redhat, inifile: tox.ini
plugins: multihost-1.1
collected 406 items 

test_ipapython/test_cookie.py ............
test_ipapython/test_dn.py ...........................
test_ipapython/test_ipautil.py ..................................................................
test_ipapython/test_ipavalidate.py ..........
test_ipapython/test_kerberos.py ..............
test_ipapython/test_keyring.py ..........
test_ipapython/test_ssh.py ...............................
test_ipalib/test_aci.py ...................
test_ipalib/test_backend.py ........
test_ipalib/test_base.py ...............
test_ipalib/test_capabilities.py .
test_ipalib/test_cli.py ...
test_ipalib/test_config.py ...............
test_ipalib/test_crud.py ...............
test_ipalib/test_errors.py .......
test_ipalib/test_frontend.py ........................................
test_ipalib/test_messages.py ....
test_ipalib/test_output.py ...
test_ipalib/test_parameters.py .............................................................
test_ipalib/test_plugable.py ........
test_ipalib/test_text.py .............................
test_ipalib/test_x509.py ...
test_pkcs10/test_pkcs10.py .....

================================================================== pytest-warning summary ==================================================================
...
====================================================== 406 passed, 59 pytest-warnings in 2.04 seconds ====================================================
_________________________________________________________________________ summary ________________________________________________________________________
  py27: commands succeeded
  congratulations :)
```

"""

See the full comment at https://github.com/freeipa/freeipa/pull/374#issuecomment-270962079


More information about the Freeipa-devel mailing list