LEW21 / pydbus

Pythonic DBus library
GNU Lesser General Public License v2.1
326 stars 76 forks source link

Support running tests via `python setup.py test` #85

Open maximbaz opened 5 years ago

maximbaz commented 5 years ago

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 commented 4 years ago

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

eli-schwartz commented 4 years ago

30 might be a bit more relevant...