Skip to content

Commit

Permalink
test: try with a timer in the loop
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Figuière <[email protected]>
  • Loading branch information
hfiguiere committed Nov 14, 2024
1 parent 67b1bce commit 7c61989
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,16 @@ def cb_device_events(session_handle, events):
assert devices_received == 2
assert devices_removed == 0

print("Removong device ", dev_path)
portal_mock.umockdev.remove_device(dev_path)
print("Removed")
def cb_remove_device():
nonlocal dev_path
nonlocal portal_mock

print("Removing device ", dev_path)
portal_mock.umockdev.remove_device(dev_path)
print("Removed")

mainloop = GLib.MainLoop()
GLib.timeout_add(100, cb_remove_device)
GLib.timeout_add(1000, mainloop.quit)
mainloop.run()

Expand Down

0 comments on commit 7c61989

Please sign in to comment.