python-dbus-next
python-dbus-next copied to clipboard
Mark integration tests
Hi! When packaging 0.2.2 for Arch Linux and running the pytest suite against the project, I ran into the issue, that some of the tests assume a functioning dbus (i.e. integration tests). However, as we build in pristine systemd-nspawn containers there is no (running) dbus or graphical session.
Full pytest log: python-dbus-next-0.2.2-build.log
Would it be possible to mark the integration tests using pytest.mark? This way they could be easily ignored using e.g. pytest -m "not integration"
).
I currently use the following to select the tests that I am not able to run:
pytest -v \
--ignore "test/test_aio_low_level.py" \
--ignore "test/test_big_message.py" \
--ignore "test/test_disconnect.py" \
--ignore "test/test_request_name.py" \
--ignore "test/test_tcp_address.py" \
--ignore "test/client/test_methods.py" \
--ignore "test/client/test_properties.py" \
--ignore "test/client/test_signals.py" \
--ignore "test/service/test_export.py" \
--ignore "test/service/test_methods.py" \
--ignore "test/service/test_properties.py" \
--ignore "test/service/test_signals.py" \
--ignore "test/service/test_standard_interfaces.py" \
-k "not test_sending_file_descriptor_low_level and not test_high_level_service_fd_passing and not test_sending_file_descriptor_with_proxy"
Yeah that sounds good.
@dvzrv, have you tried running test suite with dbus-run-session -- pytest
?
The command works for my Fedora package and our build environment is also based on systemd-nspawn containers.
@alebastr many thanks! That fixes it for me :)
I'm not very used to using dbus in the build environment, but it works with dbus-run-session -- pytest -v
.