Closed Lucas-C closed 2 years ago
Hi @Lucas-C
Apologies for the delay and thanks for reporting! It seems psutil is confused with your system. I think it will look for /proc/cpuinfo but such files do not seems to exists.
I suggest to report that point to psutil directly.
This is indeed an issue with psutil
& WSL: https://github.com/giampaolo/psutil/issues/1251
While support for this is added, could you consider having a fallback? Like other libs did: https://github.com/google/deepvariant/issues/191#issuecomment-504492772
You are absolutely right. I think that 2 issues is enough for implementing it especially with the psutil
team having difficulties in solving these issues.
I'll do my best to do it quickly.
I am thinking about a two times fallback similar to:
try:
freq = psutil.cpu_freq()
return freq.current if freq is not None else 0.0
except NotImplementedError:
return float(os.environ.get('PYTEST_MONITOR_CPU_FREQ', '0')
I think that would put your exception away and match your use case.
That look great! Thank you for taking a look at this @js-dieu 😊
Describe the bug After installing
pytest-monitor
to plug it inside https://github.com/PyFPDF/fpdf2 a stacktrace was raised when callingpytest
To Reproduce Steps to reproduce the behavior:
pip install --upgrade . pytest-monitor -r test/requirements.txt
in the cloned repo directorypytest
Expected behavior No error
Stacktrace
Desktop (please complete the following information):