depot_tools: Run roll_dep tests on Python 3.

Bug: 1009816
Change-Id: I2fac9f03b6dd275563375d8ac4d1e71b5188e468
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1925325
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/25/1925325/2
Edward Lemur 5 years ago committed by Commit Bot
parent 0ab6a9f6e4
commit 9ea51a5b11

@ -52,7 +52,7 @@ class AlreadyRolledError(Error):
def check_output(*args, **kwargs):
"""subprocess.check_output() passing shell=True on Windows for git."""
kwargs.setdefault('shell', NEED_SHELL)
return subprocess.check_output(*args, **kwargs)
return subprocess.check_output(*args, **kwargs).decode('utf-8')
def check_call(*args, **kwargs):

@ -56,6 +56,10 @@ class RollDepTest(fake_repos.FakeReposTestBase):
self.env = os.environ.copy()
self.env['DEPOT_TOOLS_UPDATE'] = '0'
self.env['DEPOT_TOOLS_METRICS'] = '0'
# Suppress Python 3 warnings and other test undesirables.
self.env['GCLIENT_TEST'] = '1'
self.maxDiff = None
self.enabled = self.FAKE_REPOS.set_up_git()
self.src_dir = os.path.join(self.root_dir, 'src')
@ -73,6 +77,8 @@ class RollDepTest(fake_repos.FakeReposTestBase):
stdout, stderr = process.communicate()
logging.debug("XXX: %s\n%s\nXXX" % (' '.join(cmd), stdout))
logging.debug("YYY: %s\n%s\nYYY" % (' '.join(cmd), stderr))
stdout = stdout.decode('utf-8')
stderr = stderr.decode('utf-8')
return (stdout.replace('\r\n', '\n'), stderr.replace('\r\n', '\n'),
process.returncode)

Loading…
Cancel
Save