You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcpuid/SOURCES/0002-Python-Do-not-fail-san...

42 lines
1.3 KiB

From eae4874e4e29d3575c04f830c23fbe3040ca7416 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= <zacik.pa@gmail.com>
Date: Sun, 1 Sep 2024 19:43:31 +0200
Subject: [PATCH] Python: Do not fail sanity tests if current CPU is
unsupported
---
python/tests/sanity_test.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/python/tests/sanity_test.py b/python/tests/sanity_test.py
index bf17dc4..4e18165 100644
--- a/python/tests/sanity_test.py
+++ b/python/tests/sanity_test.py
@@ -5,6 +5,7 @@ import tempfile
import libcpuid
from libcpuid.info import CPUInfo, SystemInfo
from libcpuid.raw import CPURawData, CPURawDataArray
+from libcpuid.errors import CLibraryError
def test_cpu_name_in_vendor_list():
@@ -12,9 +13,12 @@ def test_cpu_name_in_vendor_list():
Checks that the current CPU codename appears
in the list of all CPUs of its vendor.
"""
- info = CPUInfo.from_current_cpu()
- cpulist = libcpuid.get_cpu_list(info.vendor)
- assert info.cpu_codename in cpulist
+ try:
+ info = CPUInfo.from_current_cpu()
+ cpulist = libcpuid.get_cpu_list(info.vendor)
+ assert info.cpu_codename in cpulist
+ except CLibraryError:
+ pass
def test_serialization():
--
2.46.0