Merged
Conversation
benoit-cty
requested changes
Mar 29, 2026
Contributor
benoit-cty
left a comment
There was a problem hiding this comment.
Thank you very much for all these tests !
I just have to minor suggestion.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1147 +/- ##
==========================================
+ Coverage 83.10% 88.82% +5.72%
==========================================
Files 45 45
Lines 4279 4279
==========================================
+ Hits 3556 3801 +245
+ Misses 723 478 -245 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
For the error, run Thanks ! |
432db5f to
2cb03a4
Compare
benoit-cty
approved these changes
Mar 30, 2026
Contributor
benoit-cty
left a comment
There was a problem hiding this comment.
Thanks for the update, I will merge.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR increases package test coverage and stabilizes a couple of failing tests in the non-integration suite.
Changes included:
codecarbon.cli.authcodecarbon.cli.cli_utilscodecarbon.cli.monitorcodecarbon.core.api_clientcodecarbon.core.cpucodecarbon.core.powermetricscodecarbon.core.resource_trackercodecarbon.external.ramtests/test_core_util.pyfor Windows tempfile behaviortests/test_unsupported_gpu.pyto avoid exact-zero assertions on noisy unsupported-GPU measurementsThis raised package coverage to
85%and restored a green non-integration test run.Related Issue
N/A
Motivation and Context
The package had several low-coverage modules in CLI, API, hardware-detection, and resource-tracking paths, and the non-integration suite still had a couple of unstable failures on Windows/runtime-dependent paths.
This change improves confidence in those branches, makes the suite more deterministic across environments, and gives a cleaner baseline for future work.
How Has This Been Tested?
Tested with targeted pytest runs while adding each batch of tests, then with a full package coverage run.
Commands used:
uv run --group dev pytest tests\cli\test_cli_utils.py -quv run --group dev pytest tests\cli\test_monitor.py -quv run --group dev pytest tests\cli\test_cli_auth.py -quv run --group dev pytest tests\test_api_call.py -quv run --group dev pytest tests\test_resource_tracker.py tests\test_powermetrics.py -quv run --group dev pytest tests\test_cpu.py -quv run --group dev pytest tests\test_ram.py -quv run --group dev pytest tests\test_core_util.py -quv run --group dev pytest tests\test_unsupported_gpu.py -quv run --group dev pytest --cov --cov-report=term --cov-report=xml --ignore=tests/test_viz_data.py -q -m "not integ_test" tests/Final result:
456 passed, 19 skipped, 3 deselectedScreenshots (if appropriate):
N/A
Types of changes
What types of changes does your code introduce? Put an
xin all the boxes that apply:Checklist:
Go over all the following points, and put an
xin all the boxes that apply.