Load Dynamic Libraries and Emoji Engine on Demand (#1020)

This commit is contained in:
Chris Caron
2023-12-27 14:23:13 -05:00
committed by GitHub
parent 34a26da4f4
commit 9dcf769397
35 changed files with 1943 additions and 1064 deletions

View File

@@ -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)