Le 18/08/2014 17:48, John Mark Vandenberg a écrit :
> To run only the tests which are run by jenkins, even without a
> user-config.py file, use
> 
> PYWIKIBOT2_NO_USER_CONFIG=1 nosetests -a "!site,!net"

As an alternative, one can use tox which create virtualenv on the fly
and takes care of installing dependencies and executing the proper command.

 pip install tox
 tox

tox -l  shows a list of predefined envs that are executed by default:

 flake8   # linter
 flake8-docstrings   # pep257 docstring linter
 py26   # run test command under python 2.6
 py27   # same but with python 2.7

More can be found in the tox.ini file, such as 'nose'.


If you only want to execute the flake8:

 tox -e flake8

For nose:

 tox -e nose


Jenkins uses exactly that, so your setup should match exactly what it runs.


There is a few more details at:

 
https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Test_your_python


-- 
Antoine "hashar" Musso


_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to