summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2024-04-04 03:01:58 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2024-04-04 03:13:40 +0200
commitd065842604881d1208985026ab0ea8c1e2479e74 (patch)
tree8d587c0015b44e44052babcb4538dad351476e02
parent0a661b527cb4576995b0e50d1bb889e745a3809d (diff)
tests/fprintd: Close opened pipes on tests cleanup
-rw-r--r--tests/fprintd.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/fprintd.py b/tests/fprintd.py
index 64ea42e..d71e6d9 100644
--- a/tests/fprintd.py
+++ b/tests/fprintd.py
@@ -331,6 +331,7 @@ class FPrintdTest(dbusmock.DBusTestCase):
self._polkitd, self._polkitd_obj = self.spawn_server_template(
polkitd_template, {}, stdout=subprocess.PIPE)
+ self.addCleanup(self._polkitd.stdout.close)
self.addCleanup(self.stop_server, '_polkitd', '_polkitd_obj')
return self._polkitd
@@ -570,7 +571,7 @@ class FPrintdTest(dbusmock.DBusTestCase):
return all_replies
def gdbus_device_method_call_process(self, method, args=[]):
- return subprocess.Popen([
+ proc = subprocess.Popen([
'gdbus',
'call',
'--system',
@@ -581,6 +582,8 @@ class FPrintdTest(dbusmock.DBusTestCase):
'--method',
'{}.{}'.format(self.device.get_interface_name(), method),
] + args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
+ self.addCleanup(proc.stdout.close)
+ return proc
def call_device_method_from_other_client(self, method, args=[]):
try: