[gnome-bluetooth/wip/hadess/lib-changes: 6/8] tests: Print out stdout on error




commit 92ff3887398cfc7def999b87a7fcef80125442f1
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 23 17:36:37 2021 +0100

    tests: Print out stdout on error

 tests/integration-test | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/tests/integration-test b/tests/integration-test
index 654fcf5b..ab9d6115 100755
--- a/tests/integration-test
+++ b/tests/integration-test
@@ -132,7 +132,7 @@ class Tests(dbusmock.DBusTestCase):
         cls.start_system_bus()
         cls.dbus_con = cls.get_dbus(True)
         (cls.p_mock, cls.obj_bluez) = cls.spawn_server_template(
-            'bluez5', {}, stdout=subprocess.PIPE)
+            'bluez5', {})
 
         cls.exec_path = [sys.argv[0]]
         if os.getenv('VALGRIND') != None:
@@ -140,7 +140,6 @@ class Tests(dbusmock.DBusTestCase):
 
     @classmethod
     def tearDownClass(cls):
-        cls.p_mock.stdout.close()
         cls.p_mock.terminate()
         cls.p_mock.wait()
 
@@ -154,7 +153,7 @@ class Tests(dbusmock.DBusTestCase):
         test_name = inspect.stack()[1][3]
         # And run the test with the same name in the OopTests class in a separate process
         out = subprocess.run(self.exec_path + ['OopTests.' + test_name], capture_output=True)
-        self.assertEqual(out.returncode, 0, "Running test " + test_name + " failed:" + 
out.stderr.decode('UTF-8'))
+        self.assertEqual(out.returncode, 0, "Running test " + test_name + " failed:" + 
out.stderr.decode('UTF-8') + '\n\n\nSTDOUT:\n' + out.stdout.decode('UTF-8'))
         if os.getenv('VALGRIND') != None:
             print(out.stderr.decode('UTF-8'))
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]