mirror of
https://github.com/caronc/apprise.git
synced 2025-08-19 04:47:20 +02:00
Load Dynamic Libraries and Emoji Engine on Demand (#1020)
This commit is contained in:
@@ -31,17 +31,30 @@ import os
|
||||
|
||||
import pytest
|
||||
|
||||
from apprise.common import NOTIFY_MODULE_MAP
|
||||
from apprise.NotificationManager import NotificationManager
|
||||
from apprise.ConfigurationManager import ConfigurationManager
|
||||
from apprise.AttachmentManager import AttachmentManager
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers'))
|
||||
|
||||
# Grant access to our Notification Manager Singleton
|
||||
N_MGR = NotificationManager()
|
||||
# Grant access to our Config Manager Singleton
|
||||
C_MGR = ConfigurationManager()
|
||||
# Grant access to our Attachment Manager Singleton
|
||||
A_MGR = AttachmentManager()
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
|
||||
@pytest.fixture(scope="function", autouse=True)
|
||||
def no_throttling_everywhere(session_mocker):
|
||||
"""
|
||||
A pytest session fixture which disables throttling on all notifiers.
|
||||
It is automatically enabled.
|
||||
"""
|
||||
for notifier in NOTIFY_MODULE_MAP.values():
|
||||
plugin = notifier["plugin"]
|
||||
# Ensure we're working with a clean slate for each test
|
||||
N_MGR.unload_modules()
|
||||
C_MGR.unload_modules()
|
||||
A_MGR.unload_modules()
|
||||
|
||||
for plugin in N_MGR.plugins():
|
||||
session_mocker.patch.object(plugin, "request_rate_per_sec", 0)
|
||||
|
Reference in New Issue
Block a user