1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-11-10 22:59:13 +00:00

Python: Do not fail sanity tests if current CPU is unsupported

This commit is contained in:
Pavol Žáčik 2024-09-01 19:43:31 +02:00 committed by The Tumultuous Unicorn Of Darkness
parent 20fbc35374
commit bcd2dea9ee

View file

@ -5,6 +5,7 @@ import tempfile
import libcpuid import libcpuid
from libcpuid.info import CPUInfo, SystemInfo from libcpuid.info import CPUInfo, SystemInfo
from libcpuid.raw import CPURawData, CPURawDataArray from libcpuid.raw import CPURawData, CPURawDataArray
from libcpuid.errors import CLibraryError
def test_cpu_name_in_vendor_list(): 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 Checks that the current CPU codename appears
in the list of all CPUs of its vendor. in the list of all CPUs of its vendor.
""" """
try:
info = CPUInfo.from_current_cpu() info = CPUInfo.from_current_cpu()
cpulist = libcpuid.get_cpu_list(info.vendor) cpulist = libcpuid.get_cpu_list(info.vendor)
assert info.cpu_codename in cpulist assert info.cpu_codename in cpulist
except CLibraryError:
pass
def test_serialization(): def test_serialization():