Repository navigation
Commit 593aaad
fix: stop test_sourcecode_args from depending on an ambient HOME (#6383)
test_environment_variables_in_command_still_expand compared the shell-expanded
command against os.environ["HOME"], which fails with KeyError: 'HOME' on every
Python version in CI. The unit tests run under tox, whose filtered environment
does not pass HOME through, so the variable the test reads is simply absent.
Export a variable the module owns instead, via an autouse fixture, and assert
against its known value. The parametrized literal-argument cases that used
$HOME/${HOME} now use the same variable, so they compare a literal against a
non-empty expansion rather than against whatever the ambient environment
happens to hold.
Test-only change: the SourceCode.args behavior added for #5226 is untouched, and
reintroducing the original double-quoted CMD= assignment still fails 23 of the
28 tests in this file, including both reworked cases.
Co-authored-by: Mohamed Zeidan <zeidmo@amazon.com>1 parent 193df0f commit 593aaad
1 file changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| |||
237 | 250 | | |
238 | 251 | | |
239 | 252 | | |
240 | | - | |
241 | | - | |
| 253 | + | |
| 254 | + | |
242 | 255 | | |
243 | 256 | | |
244 | 257 | | |
| |||
301 | 314 | | |
302 | 315 | | |
303 | 316 | | |
304 | | - | |
| 317 | + | |
305 | 318 | | |
306 | 319 | | |
307 | 320 | | |
308 | 321 | | |
309 | | - | |
| 322 | + | |
310 | 323 | | |
311 | 324 | | |
312 | 325 | | |
| |||
0 commit comments