Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,8 @@ def run_cli_ok(self, *args):
return stdout.buffer.read()

def run_cmd_ok(self, *args):
return assert_python_ok('-m', 'calendar', *args)[1]
proc = assert_python_ok('-m', 'calendar', *args)
return proc.out

def assertCLIFails(self, *args):
with self.captured_stderr_with_buffer() as stderr:
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ def get_hash(self, repr_, seed=None):
env['PYTHONHASHSEED'] = str(seed)
else:
env.pop('PYTHONHASHSEED', None)
out = assert_python_ok(
proc = assert_python_ok(
'-c', self.get_hash_command(repr_),
**env)
stdout = out[1].strip()
stdout = proc.out.strip()
return int(stdout)

def test_randomized_hash(self):
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_os/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -2459,8 +2459,8 @@ def get_urandom_subprocess(self, count):
'data = os.urandom(%s)' % count,
'sys.stdout.buffer.write(data)',
'sys.stdout.buffer.flush()'))
out = assert_python_ok('-c', code)
stdout = out[1]
proc = assert_python_ok('-c', code)
stdout = proc.out
self.assertEqual(len(stdout), count)
return stdout

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_script_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestScriptHelper(unittest.TestCase):

def test_assert_python_ok(self):
t = script_helper.assert_python_ok('-c', 'import sys; sys.exit(0)')
self.assertEqual(0, t[0], 'return code was not 0')
self.assertEqual(0, t.rc, 'return code was not 0')

def test_assert_python_failure(self):
# I didn't import the sys module so this child will fail.
Expand Down
8 changes: 4 additions & 4 deletions Lib/test/test_utf8_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def posix_locale(self):
def get_output(self, *args, failure=False, **kw):
kw = dict(self.DEFAULT_ENV, **kw)
if failure:
out = assert_python_failure(*args, **kw)
out = out[2]
proc = assert_python_failure(*args, **kw)
out = proc.err
else:
out = assert_python_ok(*args, **kw)
out = out[1]
proc = assert_python_ok(*args, **kw)
out = proc.out
return out.decode().rstrip("\n\r")

@unittest.skipIf(MS_WINDOWS, 'Windows has no POSIX locale')
Expand Down
Loading