-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NotImplementedError: can't find current frequency file #60
Comments
Hi @Lucas-C Apologies for the delay and thanks for reporting! I suggest to report that point to psutil directly. |
This is indeed an issue with While support for this is added, could you consider having a fallback? |
You are absolutely right. I think that 2 issues is enough for implementing it especially with the 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! |
Allow to set the CPU frequency from an environment variable. Additionally, whenever psutil cannot resolve the cpu frequency, we use the same fallback mechanism. Added environment variables: - PYTEST_MONITOR_FORCE_CPU_FREQ (to overcome psutil) - PYTEST_MONITOR_CPU_FREQ (to set a CPU frequency value)
Allow to set the CPU frequency from an environment variable. Additionally, whenever psutil cannot resolve the cpu frequency, we use the same fallback mechanism. Added environment variables: - PYTEST_MONITOR_FORCE_CPU_FREQ (to overcome psutil) - PYTEST_MONITOR_CPU_FREQ (to set a CPU frequency value)
Allow to set the CPU frequency from an environment variable. Additionally, whenever psutil cannot resolve the cpu frequency, we use the same fallback mechanism. Added environment variables: - PYTEST_MONITOR_FORCE_CPU_FREQ (to overcome psutil) - PYTEST_MONITOR_CPU_FREQ (to set a CPU frequency value)
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):
The text was updated successfully, but these errors were encountered: