Fix PWD environment entry if cwd provided to Runner() or Runner.run() is a Path-object#7107
Conversation
$PWD environment entry if cwd' provided to Runner() or Runner.run() is a Path`-objectPWD environment entry if cwd provided to Runner() or Runner.run() is a Path-object
|
Code Climate has analyzed commit 0d727bb and detected 3 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
0d727bb to
0268ed4
Compare
bpoldrack
left a comment
There was a problem hiding this comment.
Thx, @christian-monch. LGTM.
I have two suggestions, though.
|
|
||
|
|
||
| @with_tempfile(mkdir=True) | ||
| def test_environment(temp_dir_path=None): |
There was a problem hiding this comment.
This test makes me think we have not covered the case of passing cwd to the constructor and (a different one) to the method. We probably should test that behavior, too.
There was a problem hiding this comment.
Both are tested. Line 336 -337 test passing to method, line 341-342 test passing to the constructor. Or did I missunderstand you?
There was a problem hiding this comment.
Yes, you did. We do not test what happens if the caller sets (possibly different) cwd via both - constructor and method. This is only testing the case where the caller does either one of those.
There was a problem hiding this comment.
In code: Runner(cwd="one/path").run(cwd="another/path") - what happens?
There was a problem hiding this comment.
In code:
Runner(cwd="one/path").run(cwd="another/path")- what happens?
The method provided variables take precedence over the constructor provided. Don't ask me what the original authors intended with this behavior, it might be suited to reusing "pre-configured" runners multiple times with minimal source code
There was a problem hiding this comment.
Yes, I hope, that's what happens. Point was, that this behavior seems untested.
Anyways - there was no test before, so I'm still happy to merge as is.
Swap outer string delimiters from `"´ to `'´, to satisfy certain windows environments. Put `SYSTEMROOT` into the environment passed to subprocesses on windows in order to fix errors like: cannot initialize random number generator (some libs can not be found).
a988523 to
4c1413b
Compare
|
One more thing, @christian-monch: Looks like the command quoting in the test ( |
Added: I will not change |
Agreed. Thx! |
69c2148 to
7beffc1
Compare
|
Amended the PR with a test regarding the parameter priorities. |
Codecov ReportBase: 88.34% // Head: 88.90% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## maint #7107 +/- ##
==========================================
+ Coverage 88.34% 88.90% +0.55%
==========================================
Files 355 355
Lines 46417 46533 +116
==========================================
+ Hits 41007 41369 +362
+ Misses 5410 5164 -246
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
Thanks, @christian-monch! |
|
PR released in |
Fixes #7040
This PR fixes #7040. It ensures that an environment that is provided to the subprocess contains a proper entry for
PWD. That means, the entry contains a string that describes the path of the working directory, and not a python-representation of a Path object.