From 5b7ea168081676850b647799df3d477c2822742c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 5 Dec 2017 22:47:07 +0100 Subject: [PATCH] tests: make filter-esc tests working also on travis There stderr is not a tty, so filtering isn't turned on by default. Mock os.isatty() to fake it. --- qubesadmin/tests/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qubesadmin/tests/app.py b/qubesadmin/tests/app.py index 107e6fe..4aa2ba9 100644 --- a/qubesadmin/tests/app.py +++ b/qubesadmin/tests/app.py @@ -706,6 +706,7 @@ class TC_20_QubesLocal(unittest.TestCase): with open(tmpdir + '/payload') as payload: self.assertEqual(payload.read(), 'some payload\n') + @mock.patch('os.isatty', lambda fd: fd == 2) def test_010_run_service(self): self.listen_and_send(b'0\0') with mock.patch('subprocess.Popen') as mock_proc: @@ -733,6 +734,7 @@ class TC_20_QubesLocal(unittest.TestCase): self.assertEqual(self.get_request(), b'dom0\0admin.vm.Start\0some-vm\0\0') + @mock.patch('os.isatty', lambda fd: fd == 2) def test_012_run_service_user(self): self.listen_and_send(b'0\0') with mock.patch('subprocess.Popen') as mock_proc: