From 55dd325aae0eedd955ec7bedef61c2879d593e9b Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 15 Oct 2024 16:42:28 +0000 Subject: [PATCH] tests: fix bluez test when no /etc/os-release This file doesn't exist in the Nix build sandbox. Fixes: 812dc61 ("tests: Skip bluez test_advertise on RHEL 10") --- tests/test_bluez5.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_bluez5.py b/tests/test_bluez5.py index 09c4f26..a4d0520 100644 --- a/tests/test_bluez5.py +++ b/tests/test_bluez5.py @@ -34,7 +34,8 @@ have_bluetoothctl = shutil.which("bluetoothctl") have_pbap_client = shutil.which("pbap-client") -el10 = "platform:el10" in Path("/etc/os-release").read_text("UTF-8") +os_release = Path("/etc/os-release") +el10 = os_release.exists() and "platform:el10" in os_release.read_text("UTF-8") def _run_bluetoothctl(command):