Skip to content
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

[unit tests] is_powermetrics_available stops the run to ask for sudo #565

Closed
inimaz opened this issue Jun 3, 2024 · 2 comments · Fixed by #576
Closed

[unit tests] is_powermetrics_available stops the run to ask for sudo #565

inimaz opened this issue Jun 3, 2024 · 2 comments · Fixed by #576
Labels
good first issue Good for newcomers

Comments

@inimaz
Copy link
Contributor

inimaz commented Jun 3, 2024

I am using linux system. When I ran the unit tests, when it arrives to test_powermetrics.py, it asks for sudo permissions to run it.

tests/test_powermetrics.py::TestApplePowerMetrics::test_get_details [sudo] password for inigo: 
Sorry, try again.
[sudo] password for inigo: 
...

How to reproduce

Run
hatch run test:package

@inimaz inimaz added the good first issue Good for newcomers label Jun 3, 2024
@benoit-cty
Copy link
Contributor

Thanks ! I'm having the same problem under Linux. But as it doesn't happened in CI I though it was a local problem.

@benoit-cty
Copy link
Contributor

benoit-cty commented Jun 16, 2024

I think it's [this line](def _has_powermetrics_sudo():) that don't work as expected : if re.search(r"[sudo].*password", stderr):

Solution proposal : #576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants