Closed M4rtinK closed 7 years ago
I guess unittest's autodiscover is loading examples/clientserver/client.py looking for tests and in that process the code gets executed (as the module lacks an if __name__=='main'
condition). client.py is an example module that needs the example module server.py to also be running, that's why it fails in your case.
As they are now, pydbus tests are not meant to be discovered (although that may change in future releases).
pydbus' tests need to be run in a context where a session DBUS daemon is running. If you run the tests inside your desktop session, it will probably already be one, but that won't be the case if, for example, your package is tested in a build server, a chroot environment or a minimal docker container. tests/run.sh launches such daemon and runs the tests (also have a look at some improvements I proposed in https://github.com/LEW21/pydbus/pull/38). I guess your best bet would be using that script or some variation of it in the test phase of your package build.
I'm in the process of packaging pydbus for Debian, and have used such a script to run the tests.
./tests/run.sh
I've merged #38 and released 0.6.0, so it should work well now.
Thanks for packaging pydbus!
I'm currently packaging pydbus for Fedora and the Fedora packaging guidelines recommend running tests during the package build if possible. So I've tried to run the pydbus tests with:
python3 setup.py test
But that results in a traceback:
Am I possibly running the pydbus tests incorrectly or is some additional setup required before the tests can be started (I see some docker files in the tests directory) ?