File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import sys
33import textwrap
44import unittest
5- import subprocess
5+ from subprocess import Popen , PIPE
66from test import support
77from test .support .script_helper import assert_python_ok
88
@@ -61,12 +61,11 @@ class TestTool(unittest.TestCase):
6161 """ )
6262
6363 def test_stdin_stdout (self ):
64- with subprocess .Popen (
65- (sys .executable , '-m' , 'json.tool' ),
66- stdin = subprocess .PIPE , stdout = subprocess .PIPE ) as proc :
64+ args = sys .executable , '-m' , 'json.tool'
65+ with Popen (args , stdin = PIPE , stdout = PIPE , stderr = PIPE ) as proc :
6766 out , err = proc .communicate (self .data .encode ())
6867 self .assertEqual (out .splitlines (), self .expect .encode ().splitlines ())
69- self .assertEqual (err , None )
68+ self .assertEqual (err , b'' )
7069
7170 def _create_infile (self ):
7271 infile = support .TESTFN
You can’t perform that action at this time.
0 commit comments