How to run py.test and linters in `python setup.py test` -


i have project setup.py file. use pytest testing framework , run various linters on code (pep8, pylint, pydocstyle, pyflakes, etc). use tox run these in several python versions, build documentation using sphinx.

i run test suites linters on source code python setup.py test task. if acheive this, use python setup.py test command running tests in tox.ini file.

so questions are:

  1. is reasonable / practice these actions python setup.py test? or should use other tool that, writing command directly in tox?
  2. how setup.py these actions in test task?

i know py.test has integration instructions setup.py test (here: http://pytest.org/latest/goodpractices.html#integrating-with-setuptools-python-setup-py-test-pytest-runner), i'm looking more "arbitrary cli commands" route, since want run several tools.

1. prefer tox these tasks, because

  • it check if deps install (on py-versions)
  • it can test code multiple python-versions (virtualenv)

and setup (since you're using tox) don't see benefits of writing python setup.py test instead of exact test-commands tox.ini, because add more complexitiy (new users/contributors have search 2 files (tox.ini , setup.py) tests/tools running instead of 1 (tox.ini).


2.

to use command, project’s tests must wrapped in unittest test suite either function, testcase class or method, or module or package containing testcase classes.

setuptools#test


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -