Skip to content

Commit bcd2dea

Browse files
Python: Do not fail sanity tests if current CPU is unsupported
1 parent 20fbc35 commit bcd2dea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

python/tests/sanity_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55
import libcpuid
66
from libcpuid.info import CPUInfo, SystemInfo
77
from libcpuid.raw import CPURawData, CPURawDataArray
8+
from libcpuid.errors import CLibraryError
89

910

1011
def test_cpu_name_in_vendor_list():
1112
"""
1213
Checks that the current CPU codename appears
1314
in the list of all CPUs of its vendor.
1415
"""
15-
info = CPUInfo.from_current_cpu()
16-
cpulist = libcpuid.get_cpu_list(info.vendor)
17-
assert info.cpu_codename in cpulist
16+
try:
17+
info = CPUInfo.from_current_cpu()
18+
cpulist = libcpuid.get_cpu_list(info.vendor)
19+
assert info.cpu_codename in cpulist
20+
except CLibraryError:
21+
pass
1822

1923

2024
def test_serialization():

0 commit comments

Comments
 (0)