diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-30 22:24:16 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-30 22:24:16 -0400 |
commit | 28dc923199d432a838a19fd1d2a57a780926f272 (patch) | |
tree | 8b0c892e1cbea4d5992b4bb46fc46084f303c7f2 | |
parent | d5dc5d283b6d28ee71758a93df3bb2db697184a1 (diff) | |
download | python-coveragepy-git-28dc923199d432a838a19fd1d2a57a780926f272.tar.gz |
test: simplify run_command output handling
The type-check is left over from Python 2 compatibility, we don't need
it anymore.
-rw-r--r-- | tests/helpers.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 369875b9..40b0f481 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -34,17 +34,15 @@ def run_command(cmd): cmd, shell=True, env=sub_env, - stdin=subprocess.PIPE, stdout=subprocess.PIPE, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) output, _ = proc.communicate() status = proc.returncode # Get the output, and canonicalize it to strings with newlines. - if not isinstance(output, str): - output = output.decode(output_encoding()) - output = output.replace('\r', '') - + output = output.decode(output_encoding()).replace("\r", "") return status, output |