Skip to content

Commit

Permalink
Python: Do not fail sanity tests if current CPU is unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
zacikpa committed Sep 1, 2024
1 parent d541364 commit 38fddc2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/tests/sanity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@
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():
"""
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():
Expand Down

0 comments on commit 38fddc2

Please sign in to comment.