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

test: properly mock os.uname calls #335

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Jun 7, 2024

Use unittest.mock.patch to mock calls to os.uname instead of manually replacing and restoring os.uname.

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.53%. Comparing base (46c27c6) to head (60a259f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #335      +/-   ##
==========================================
- Coverage   82.54%   82.53%   -0.01%     
==========================================
  Files          94       94              
  Lines       19362    19353       -9     
  Branches     3114     3115       +1     
==========================================
- Hits        15982    15973       -9     
  Misses       2883     2883              
  Partials      497      497              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdrung bdrung requested a review from schopin-pro June 7, 2024 20:33
@bdrung bdrung changed the title test: propery mock os.uname calls test: properly mock os.uname calls Jun 8, 2024
@schopin-pro
Copy link
Contributor

Tests are mad!

Use `unittest.mock.patch` to mock calls to `os.uname` instead of
manually replacing and restoring `os.uname`.
@schopin-pro schopin-pro merged commit 684c60d into canonical:main Jun 12, 2024
21 checks passed
@bdrung bdrung deleted the fix-uname-mock branch June 12, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants