mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2026-05-09 07:08:03 +02:00
tests: Cleanup inhibitor fifo properly
Unlink the fifo itself and use addCleanup to close it.
This commit is contained in:
parent
fc7e058e93
commit
5d7422e17a
1 changed files with 2 additions and 2 deletions
|
|
@ -601,7 +601,9 @@ class FPrintdVirtualDeviceBaseTest(FPrintdVirtualImageDeviceBaseTests):
|
|||
|
||||
fifo_path = os.path.join(self.tmpdir, 'logind_inhibit_fifo')
|
||||
os.mkfifo(fifo_path)
|
||||
self.addCleanup(os.unlink, fifo_path)
|
||||
self.logind_inhibit_fifo = os.open(fifo_path, os.O_RDONLY | os.O_NONBLOCK | os.O_CLOEXEC)
|
||||
self.addCleanup(os.close, self.logind_inhibit_fifo)
|
||||
# EOF without a writer, BlockingIOError with a writer
|
||||
self.assertFalse(self.holds_inhibitor())
|
||||
|
||||
|
|
@ -662,8 +664,6 @@ class FPrintdVirtualDeviceBaseTest(FPrintdVirtualImageDeviceBaseTests):
|
|||
self.device = None
|
||||
self.manager = None
|
||||
|
||||
os.close(self.logind_inhibit_fifo)
|
||||
|
||||
super().tearDown()
|
||||
|
||||
def try_release(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue