Skip to content

sandboxutils: use return early pattern in make_sandbox()#582

Open
bdrung wants to merge 1 commit intocanonical:mainfrom
bdrung:continue-early
Open

sandboxutils: use return early pattern in make_sandbox()#582
bdrung wants to merge 1 commit intocanonical:mainfrom
bdrung:continue-early

Conversation

@bdrung
Copy link
Copy Markdown
Member

@bdrung bdrung commented Apr 21, 2026

Use the return early pattern in make_sandbox to make the code more readable and to ease adding type hints to ProblemReport later. This change avoids duplicating the code for the failure case.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 65.21739% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.46%. Comparing base (be024b6) to head (6ce6679).

Files with missing lines Patch % Lines
apport/sandboxutils.py 65.21% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #582      +/-   ##
==========================================
+ Coverage   84.45%   84.46%   +0.01%     
==========================================
  Files         104      104              
  Lines       20939    20944       +5     
  Branches     3212     3212              
==========================================
+ Hits        17683    17690       +7     
+ Misses       2816     2814       -2     
  Partials      440      440              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bdrung bdrung force-pushed the continue-early branch 2 times, most recently from 0e15958 to ce6f918 Compare April 21, 2026 11:51
Use the return early pattern in `make_sandbox` to make the code more
readable and to ease adding type hints to `ProblemReport` later. This
change avoids duplicating the code for the failure case. Do not reuse
the iterator key to allow mypy to correctly derive the type of the
`report.get()` call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant