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.
Projectworkhorsy/py-cpuinfo
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
| 265 | 265 | cpuinfo.BackupCPUID._run_asm = cpuinfo.CPUID._run_asm | |
| 266 | 266 | cpuinfo.BackupCPUID._asm_func = cpuinfo.CPUID._asm_func | |
| 267 | 267 | ||
| 268 | - | def monkey_patch_cpuid(cpuinfo, return_values): | |
| 268 | + | def monkey_patch_cpuid(cpuinfo, return_hz, return_values): | |
| 269 | 269 | class MockCPUID(object): | |
| 270 | 270 | _counter = 0 | |
| 271 | 271 | _is_first = False | |
| ⋯ | |||
| 276 | 276 | MockCPUID._is_first = not MockCPUID._is_first | |
| 277 | 277 | ||
| 278 | 278 | if MockCPUID._is_first: | |
| 279 | - | return 19233706151817 | |
| 279 | + | return return_hz | |
| 280 | 280 | else: | |
| 281 | - | return 19237434253761 | |
| 281 | + | return 0 | |
| 282 | 282 | ||
| 283 | 283 | return retval_func, 0 | |
| 284 | 284 | ||
The check that tells the two apart
fail→pass·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
- 2017-04-19_get_cpu_info_from_ibm_pa_features
- 2017-04-10_get_cpu_info_from_cpufreq_info
- 2017-04-07Fixed Bug #63: Include py-cpuinfo version in output
- 2017-04-05_get_cpu_info_from_sysctl