tests: make tests not fail with substituted sys.stdout

At best lets skip tests in such a case.
This commit is contained in:
Marek Marczykowski-Górecki 2017-04-30 22:54:20 +02:00
parent 09acf4729b
commit 206f1a7c5b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 7 additions and 1 deletions

View File

@ -22,12 +22,18 @@ import io
import unittest.mock
import subprocess
import sys
import qubesmgmt.tests
import qubesmgmt.tools.qvm_run
class TC_00_qvm_run(qubesmgmt.tests.QubesTestCase):
def setUp(self):
if sys.stdout is not sys.__stdout__ or \
sys.stderr is not sys.__stderr__:
self.skipTest('qvm-run change behavior on redirected stdout/stderr')
super(TC_00_qvm_run, self).setUp()
def test_000_run_single(self):
self.app.expected_calls[
('dom0', 'mgmt.vm.List', None, None)] = \

View File

@ -48,7 +48,7 @@ class TC_00_qvm_start_gui(qubesmgmt.tests.QubesTestCase):
b'KWIN_RUNNING = 0x1\n',
b'access control enabled, only authorized clients can connect\n'
b'SI:localuser:root\n'
b'SI:localuser:' + os.getlogin().encode() + b'\n',
b'SI:localuser:' + os.environ['USER'].encode() + b'\n',
]
args = self.launcher.kde_guid_args(self.app.domains['test-vm'])