-
Notifications
You must be signed in to change notification settings - Fork 113
Honor the copy parameter _get_adjusted_env() #7399
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
Honor the copy parameter _get_adjusted_env() #7399
Conversation
This commit lets WitlessRunner._get_adjusted_env() honor the copy parameter. It also improves the docstring of the method.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## maint #7399 +/- ##
==========================================
+ Coverage 88.76% 91.51% +2.74%
==========================================
Files 327 325 -2
Lines 44693 43408 -1285
Branches 5924 5825 -99
==========================================
+ Hits 39671 39724 +53
+ Misses 5007 3668 -1339
- Partials 15 16 +1
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments, but since the change is quite profound but also easy to test -- would be great to see a dedicated unittest (if we had it to start with - unlikely we grew such a bug)
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
This commit adds a unit test for Runner._get_adjusted_env to ensure the correct copy-behavior, i.e. copy an env only if `copy` is `True`.
Hi @yarikoptic , thanks for the review. Yes, a test is a good ideat. I added it. Thanks for the hint. |
This commit ensures locally, i.e. independent of previous control flow, that containment is tested against dictionaries and not against None-values. The type checker does not determine that a non-None original environment will lead to a non-None adjusted environment, when Runner._get_adjusted_env is called. We help it with an `assert` that states this fact.
PR released in |
This PR modifies
WitlessRunner._get_adjusted_env()
to honor thecopy
-parameter and perform a copy only ifcopy
isTrue
.In addition, it improves the docstring of the method.