summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhmdanas <triallax@tutanota.com>2023-01-11 00:58:07 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-01-11 13:59:01 +1000
commit492b0056a2f6776f336cf6887cf5458db3794617 (patch)
tree1dac1a831be1867a120bd9ab16fd53bd6a8167c5
parent8a3986b711ae88f47b413e7a80c4fe0541c4695b (diff)
downloadlibwacom-492b0056a2f6776f336cf6887cf5458db3794617.tar.gz
tests: fix failure if system doesn't use systemd
Fixes https://github.com/linuxwacom/libwacom/issues/515.
-rw-r--r--test/test_udev_rules.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test_udev_rules.py b/test/test_udev_rules.py
index 0e8e99c..0418905 100644
--- a/test/test_udev_rules.py
+++ b/test/test_udev_rules.py
@@ -23,8 +23,13 @@ import sys
def systemd_reload():
'''Make sure our hwdb and udev rules are up-to-date'''
import subprocess
- subprocess.run(['systemd-hwdb', 'update'])
- subprocess.run(['systemctl', 'daemon-reload'])
+ try:
+ subprocess.run(['systemd-hwdb', 'update'])
+ subprocess.run(['systemctl', 'daemon-reload'])
+ except FileNotFoundError:
+ # If any of the commands above are not found (most likely the system
+ # simply does not use systemd), just skip.
+ raise pytest.skip()
def pytest_generate_tests(metafunc):