Whole file

workhorsy/py-cpuinfo

The author described this change as Fixed issue with CPUID tests having wrong mock Hz.. It counts as a record because the check below fails on the code as it stood at 89b7dfd1c and passes on c5a4a3926, with nothing else changed between the two runs.

Fix saved2019-05-09
Sharing licenceMIT · LICENSE
Change size+3 3

What the code was meant to do, written into the code itself as a save note

Fixed issue with CPUID tests having wrong mock Hz.

The change

265265 cpuinfo.BackupCPUID._run_asm = cpuinfo.CPUID._run_asm
266266 cpuinfo.BackupCPUID._asm_func = cpuinfo.CPUID._asm_func
267267
268-def monkey_patch_cpuid(cpuinfo, return_values):
268+def monkey_patch_cpuid(cpuinfo, return_hz, return_values):
269269 class MockCPUID(object):
270270 _counter = 0
271271 _is_first = False
276276 MockCPUID._is_first = not MockCPUID._is_first
277277
278278 if MockCPUID._is_first:
279- return 19233706151817
279+ return return_hz
280280 else:
281- return 19237434253761
281+ return 0
282282
283283 return retval_func, 0
284284

The check that tells the two apart

failpass·tests/test_windows_10_x86_64.py::TestWindows_10_X86_64::test_all

Check file tests/test_windows_10_x86_64.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it89b7dfd1c2b81bd81acefdc09d5dca203998821c
Broken version dated2019-05-07
Moduletests.helpers
Units changedmonkey_patch_cpuid
Fingerprintd90150ed807e368a
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in workhorsy/py-cpuinfo