summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xplugins/power/test.py8
-rw-r--r--tests/gsdtestcase.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/power/test.py b/plugins/power/test.py
index 3157c6b0..b22bafed 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -50,7 +50,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
'gnome_screensaver', stdout=subprocess.PIPE)
gsdtestcase.set_nonblock(self.screensaver.stdout)
- self.session_log_write = open(os.path.join(self.workdir, 'gnome-session.log'), 'wb')
+ self.session_log_write = open(os.path.join(self.workdir, 'gnome-session.log'), 'wb', buffering=0)
self.session = subprocess.Popen(['gnome-session', '-f',
'-a', os.path.join(self.workdir, 'autostart'),
'--session=dummy', '--debug'],
@@ -67,7 +67,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
print('----- session log -----\n%s\n------' % f.read())
raise
- self.session_log = open(self.session_log_write.name)
+ self.session_log = open(self.session_log_write.name, buffering=0)
self.obj_session_mgr = self.session_bus_con.get_object(
'org.gnome.SessionManager', '/org/gnome/SessionManager')
@@ -90,7 +90,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
self.settings_gsd_power = Gio.Settings('org.gnome.settings-daemon.plugins.power')
Gio.Settings.sync()
- self.plugin_log_write = open(os.path.join(self.workdir, 'plugin_power.log'), 'wb')
+ self.plugin_log_write = open(os.path.join(self.workdir, 'plugin_power.log'), 'wb', buffering=0)
# avoid painfully long delays of actions for tests
env = os.environ.copy()
# Disable the use of the PolicyKit helper for brightness
@@ -106,7 +106,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
env=env)
# you can use this for reading the current daemon log in tests
- self.plugin_log = open(self.plugin_log_write.name)
+ self.plugin_log = open(self.plugin_log_write.name, buffering=0)
# wait until plugin is ready
timeout = 100
diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py
index 67916330..a3515c07 100644
--- a/tests/gsdtestcase.py
+++ b/tests/gsdtestcase.py
@@ -137,7 +137,7 @@ class GSDTestCase(X11SessionTestCase):
# You can rename the log file to *.log if you want to see it on test
# case failures
- klass.monitor_log = open(os.path.join(klass.workdir, 'dbus-monitor.out'), 'wb')
+ klass.monitor_log = open(os.path.join(klass.workdir, 'dbus-monitor.out'), 'wb', buffering=0)
klass.monitor = subprocess.Popen(['dbus-monitor', '--monitor'],
stdout=klass.monitor_log,
stderr=subprocess.STDOUT)
@@ -172,7 +172,7 @@ class GSDTestCase(X11SessionTestCase):
def start_mutter(klass):
''' start mutter '''
- klass.mutter_log = open(os.path.join(klass.workdir, 'mutter.log'), 'wb')
+ klass.mutter_log = open(os.path.join(klass.workdir, 'mutter.log'), 'wb', buffering=0)
# See https://gitlab.gnome.org/GNOME/mutter/merge_requests/15
klass.mutter = subprocess.Popen(['mutter', '--x11'],
stdout=klass.mutter_log,