Skip to content

Commit

Permalink
test(preferences_server): await async tests w asyncio.run
Browse files Browse the repository at this point in the history
  • Loading branch information
friday committed Apr 21, 2024
1 parent 6405004 commit 1e382b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ui/test_preferences_server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio

import pytest

from ulauncher.ui.preferences_server import PreferencesServer
Expand Down Expand Up @@ -26,7 +28,7 @@ def prefs_server(self, webview, autostart_pref):
return server

def test_apply_settings_show_tray_icon(self, prefs_server):
prefs_server.apply_settings("show_tray_icon", False)
asyncio.run(prefs_server.apply_settings("show_tray_icon", False))
assert prefs_server.settings.show_tray_icon is False
assert settings.show_tray_icon is False

Expand All @@ -39,5 +41,5 @@ def test_set_autostart(self, prefs_server, autostart_pref):

def test_set_grab_mouse_pointer_dash_underscore_conversion(self, prefs_server):
# Verify that setting with dash character is converted to underscore
prefs_server.apply_settings("grab-mouse-pointer", True)
asyncio.run(prefs_server.apply_settings("grab-mouse-pointer", True))
assert settings.grab_mouse_pointer is True

0 comments on commit 1e382b8

Please sign in to comment.