Describe the bug
When running on a system whose architecture is such that psutil.cpu_freq() returns None, pytest-monitor crashes pytest on startup:
AttributeError: 'NoneType' object has no attribute 'current'
To Reproduce
An example of an architecture with this problem is 5.10.104-linuxkit, the version used by the Docker image python:3.9-slim-buster.
As of the current version 5.9.0, psutil tries to find the CPU service in /sys/devices/system/cpu/cpufreq/policy0 or /sys/devices/system/cpu/cpu0/cpufreq; if it can't find it there, it checks /proc/cpuinfo for lines starting with cpu mhz. But that doesn't always work (in my case the CPU was given only in BogoMIPS). In that case it returns None, triggering this crash.
Expected behavior
Prefer that pytest-monitor fails gracefully in this case, or perhaps defaults CPU utilization to zero and emits a warning.
Desktop (please complete the following information):
Describe the bug When running on a system whose architecture is such that
psutil.cpu_freq()
returnsNone
,pytest-monitor
crashespytest
on startup:To Reproduce
An example of an architecture with this problem is
5.10.104-linuxkit
, the version used by the Docker imagepython:3.9-slim-buster
.As of the current version 5.9.0,
psutil
tries to find the CPU service in/sys/devices/system/cpu/cpufreq/policy0
or/sys/devices/system/cpu/cpu0/cpufreq
; if it can't find it there, it checks/proc/cpuinfo
for lines starting withcpu mhz
. But that doesn't always work (in my case the CPU was given only in BogoMIPS). In that case it returnsNone
, triggering this crash.Expected behavior
Prefer that
pytest-monitor
fails gracefully in this case, or perhaps defaults CPU utilization to zero and emits a warning.Desktop (please complete the following information):