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

Support running tests via python setup.py test #85

Open
maximbaz opened this issue Jan 1, 2019 · 2 comments
Open

Support running tests via python setup.py test #85

maximbaz opened this issue Jan 1, 2019 · 2 comments

Comments

@maximbaz
Copy link

maximbaz commented Jan 1, 2019

I'm packaging for Arch Linux and want to run tests as part of the build. I've noticed that test suite is quite unusual, implemented as a tests/run.sh which doesn't really work for me because it expects the library to already be installed prior to running tests. However I want first to run tests, and only if they succeed proceed with installation.

The usual way to run tests is support command python setup.py test. What this does is creates an egg and runs tests inside, without having to install the package first.

Here are the exact commands I want to execute as part of packaging process:

# build the package:
python setup.py build

# run tests:
python setup.py test

# install the package:
python setup.py install --skip-build

I also noticed I'm not the only person who is surprised by the way of executing unit tests (#40).

Would you be interested in investigating and improving this? Here's a random example of a package that follows this guideline, maybe you can use it for reference:

https://github.com/regebro/tzlocal/blob/e3d97f1eb37928cc77b89a4a80fdb968277383a8/setup.py#L42

@jtojnar
Copy link

jtojnar commented Dec 27, 2019

python setup.py test is now deprecated so it would need to be a different mechanism.

@eli-schwartz
Copy link

#30 might be a bit more relevant...

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

No branches or pull requests

3 participants