Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
qarkai authored and caronc committed Dec 16, 2023
1 parent 85dfe45 commit 90cbf3a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apprise/plugins/NotifyDBus.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def __init__(self, urgency=None, x_axis=None, y_axis=None,

except (TypeError, ValueError):
# Invalid x/y values specified
msg = f'The x,y coordinates specified ({x_axis},{y_axis}) are invalid.'
msg = 'The x,y coordinates specified ({},{}) are invalid.'\
.format(x_axis, y_axis)
self.logger.warning(msg)
raise TypeError(msg)
else:
Expand Down
12 changes: 8 additions & 4 deletions test/test_plugin_glib.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
pytest.skip("Skipping dbus-python based tests", allow_module_level=True)


import gi
import gi # noqa E402
gi.require_version("GLib", "2.0")
from gi.repository import GLib
from gi.repository import GLib # noqa E402

from apprise.plugins.NotifyDBus import DBusUrgency, NotifyDBus # noqa E402

Expand Down Expand Up @@ -438,7 +438,10 @@ def test_plugin_dbus_module_croaks(mocker, dbus_glib_environment):

# Make importing `gi.repository.Gio` raise an ImportError.
mocker.patch.dict(
sys.modules, {'gi.repository.Gio': compile('raise ImportError()', 'gi.repository.Gio', 'exec')})
sys.modules,
{'gi.repository.Gio': compile('raise ImportError()',
'gi.repository.Gio',
'exec')})

# When patching something which has a side effect on the module-level code
# of a plugin, make sure to reload it.
Expand All @@ -455,7 +458,8 @@ def test_plugin_dbus_session_croaks(mocker, dbus_glib_environment):
Verify notification fails if DBus croaks.
"""

mocker.patch('gi.repository.Gio.DBusProxy.new_for_bus_sync', side_effect=GLib.Error('test'))
mocker.patch('gi.repository.Gio.DBusProxy.new_for_bus_sync',
side_effect=GLib.Error('test'))
setup_glib_environment()

obj = apprise.Apprise.instantiate('dbus://', suppress_exceptions=False)
Expand Down

0 comments on commit 90cbf3a

Please sign in to comment.