PyUpgrade: Replace pipes with `capture_output=True`
Creating this PR for visibility. It will remain a draft until the following two issues are resolved:
- I am not sure how to avoid double counting errors, since there are two different ranges and two different fixes need to be applied.
- Currently the
autofix::Fix::deletionseems to be leaving extra dangling commas and spaces. I am assuming this is my error, and will dig in for a fix.
Update: Both of these fixed, lets get this merged.
A part of #827
Sweet, will review today.
May I suggest to include test cases from pyupgrade? https://github.com/asottile/pyupgrade/blob/main/tests/features/capture_output_test.py
Examples I don't see covered:
run(["foo"], stdout=None, stderr=PIPE)
from foo import PIPE
from subprocess import run
subprocess.run(["foo"], stdout=PIPE, stderr=PIPE)
(Oh, yes please, I forgot that we were including the pyupgrade test cases.)
I will add them for both of my PRs
🙏 Thank you
She passed em flawlessly!