File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 2
2
import sys
3
3
import textwrap
4
4
import unittest
5
- import subprocess
5
+ from subprocess import Popen , PIPE
6
6
from test import support
7
7
from test .support .script_helper import assert_python_ok
8
8
@@ -61,12 +61,11 @@ class TestTool(unittest.TestCase):
61
61
""" )
62
62
63
63
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 :
67
66
out , err = proc .communicate (self .data .encode ())
68
67
self .assertEqual (out .splitlines (), self .expect .encode ().splitlines ())
69
- self .assertEqual (err , None )
68
+ self .assertEqual (err , b'' )
70
69
71
70
def _create_infile (self ):
72
71
infile = support .TESTFN
You can’t perform that action at this time.
0 commit comments