buildman: dtoc: Suppress unwanted output from test

There are a few test cases which print output. Suppress this so that tests
can run silently in the normal case.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2018-10-01 21:12:43 -06:00
parent 86af511d89
commit 4b4bc06ef4
2 changed files with 7 additions and 3 deletions

View file

@ -20,6 +20,7 @@ import control
import command
import commit
import terminal
import test_util
import toolchain
use_network = True
@ -422,7 +423,8 @@ class TestBuild(unittest.TestCase):
def testToolchainDownload(self):
"""Test that we can download toolchains"""
if use_network:
url = self.toolchains.LocateArchUrl('arm')
with test_util.capture_sys_output() as (stdout, stderr):
url = self.toolchains.LocateArchUrl('arm')
self.assertRegexpMatches(url, 'https://www.kernel.org/pub/tools/'
'crosstool/files/bin/x86_64/.*/'
'x86_64-gcc-.*-nolibc_arm-.*linux-gnueabi.tar.xz')