Capture XML output from test

Running a test with input yaml will result in output XML being sent
to the stdout. Use mock on the console to capture this so that running
the tests via testtools directly doesn't output unnecessarily

Change-Id: I4ccbfcb464d40a77c04913cb8281a0167504e1a4
This commit is contained in:
Darragh Bailey 2018-03-07 14:14:38 +00:00
parent 324e0197c4
commit 3fe85e5bbd
1 changed files with 3 additions and 1 deletions

View File

@ -58,7 +58,9 @@ class TestTests(CmdTestsBase):
os.path.join(self.fixtures_path,
'cmd-001.yaml'),
'foo-job']
self.execute_jenkins_jobs_with_args(args)
console_out = io.BytesIO()
with mock.patch('sys.stdout', console_out):
self.execute_jenkins_jobs_with_args(args)
def test_console_output(self):
"""