Skip to content
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

Provide a standardized way to run tests from cmdline #1018

Closed
giampaolo opened this issue Apr 24, 2017 · 1 comment
Closed

Provide a standardized way to run tests from cmdline #1018

giampaolo opened this issue Apr 24, 2017 · 1 comment

Comments

@giampaolo
Copy link
Owner

giampaolo commented Apr 24, 2017

This idea originated from the discussion at #987.
Right now the recommended way to run tests is to get a copy of the source distribution (namely via GIT) and run make test which will:

  1. install psutil
  2. install testing deps (unittest2, mock, pywin32 etc.)
  3. run tests

It would be nice, though, to provide a way to quickly test the psutil installation via cmdline and have it documented. Right now, the undocumented way is:

python -c "from psutil.tests.runner import main; main()"

...but it's a bit twisted. CPython accomplishes this with (https://docs.python.org/devguide/runtests.html):

python -m test

It would be nice if psutil did the same:

python -m psutil.test

This should be implemented and documented in the official doc as a quick way to make sure whether psutil works on the designated user platform (aka running tests) without cloning the GIT repo or downloading the tarball.

Currently the GIT cloned code / tarball allows you to make test and make setup-dev-env in order to install the testing deps (unittest2, mock, pywin32, etc.), which is another useful use case, so we should also be able to:

python -m psutil.test --install-deps

If python -m psutil.test fails for a missing dep, the error message should tell the user to use --install-deps first.

@giampaolo
Copy link
Owner Author

PR: #1019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant