@@ -11,7 +11,13 @@ class TestOutputs(unittest.TestCase):
1111
1212def test_against_expected (test_file , expected_file , env ):
1313 def test (self ):
14- result = subprocess .run (["python" , test_file ], env = env , capture_output = True )
14+ # Using `stdout=PIPE, stderr=PIPE` for Python 3.6 compatibility instead of `capture_output=True`
15+ result = subprocess .run (
16+ ["python" , test_file ],
17+ env = env ,
18+ stdout = subprocess .PIPE ,
19+ stderr = subprocess .PIPE ,
20+ )
1521 with open (expected_file , "r" , encoding = "utf-8" ) as r :
1622 # Allow duration to change
1723 expected = re .sub (
@@ -28,7 +34,13 @@ def get_commands(output):
2834
2935def test_against_sample (test_file , sample_file , env ):
3036 def test (self ):
31- result = subprocess .run (["python" , test_file ], env = env , capture_output = True )
37+ # Using `stdout=PIPE, stderr=PIPE` for Python 3.6 compatibility instead of `capture_output=True`
38+ result = subprocess .run (
39+ ["python" , test_file ],
40+ env = env ,
41+ stdout = subprocess .PIPE ,
42+ stderr = subprocess .PIPE ,
43+ )
3244 with open (sample_file , "r" , encoding = "utf-8" ) as r :
3345 # Ensure that it contains the same output structure
3446 self .assertEqual (
0 commit comments