fix: correct error message for stdout pipe check in run_process#3416
fix: correct error message for stdout pipe check in run_process#3416nightcityblade wants to merge 4 commits intopython-trio:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3416 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 128 128
Lines 19424 19417 -7
Branches 1318 1318
===============================================
- Hits 19424 19417 -7
🚀 New features to boost your workflow:
|
|
You forgot to update the tests mate |
|
Good catch @CoolCat467! Updated the test to match the corrected error message — the stdin pipe check now expects |
|
Please fix the news fragment syntax! |
src/trio/_tests/test_subprocess.py
Outdated
| pipe_stdin_error = r"^stdin=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)*$" | ||
| with pytest.raises(ValueError, match=pipe_stdin_error): | ||
| await run_process(CAT, stdin=subprocess.PIPE) | ||
| pipe_stdout_error = r"^stdout=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)*$" |
There was a problem hiding this comment.
The last part uses a * but I think the regex can be more specific.
(Same comment applies for the one above, too)
|
Fixed — switched to double backticks ( |
|
Please address the review too! (and you don't need to write out a comment acknowledging what you finished; the commits have that data.) |
A5rocks
left a comment
There was a problem hiding this comment.
Sorry, I was thinking something like this. What do you think?
|
|
||
| pipe_stdout_error = r"^stdout=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)*$" | ||
| with pytest.raises(ValueError, match=pipe_stdout_error): | ||
| pipe_stdin_error = r"^stdin=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)?$" |
There was a problem hiding this comment.
| pipe_stdin_error = r"^stdin=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)?$" | |
| pipe_stdin_error = r"^stdin=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe; use nursery\.start or pass the data you want to write directly$" |
| pipe_stdin_error = r"^stdin=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)?$" | ||
| with pytest.raises(ValueError, match=pipe_stdin_error): | ||
| await run_process(CAT, stdin=subprocess.PIPE) | ||
| pipe_stdout_error = r"^stdout=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)?$" |
There was a problem hiding this comment.
| pipe_stdout_error = r"^stdout=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe(; use nursery\.start or pass the data you want to write directly)?$" | |
| pipe_stdout_error = r"^stdout=subprocess\.PIPE is only valid with nursery\.start, since that's the only way to access the pipe$" |
Fixes #3409
The error message for the
stdout=subprocess.PIPEcheck inrun_processincorrectly said "stdin=subprocess.PIPE". This fixes it to say "stdout=subprocess.PIPE".This is a recreation of #3398 with the same fix plus a newsfragment.