diff options
author | Frederick Muriuki Muriithi | 2025-07-30 09:54:18 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-07-30 09:54:18 -0500 |
commit | 7382e55abd2b55df53cfd47ac2efe4d7a43b1275 (patch) | |
tree | 76fdc91b22376da7724ecac1a46e3a7ad9c8a407 | |
parent | cb8fe53f54e5e2065c6a4829aecce1db093d9034 (diff) | |
download | gn-auth-7382e55abd2b55df53cfd47ac2efe4d7a43b1275.tar.gz |
Add global configurations for warnings filters.
-rw-r--r-- | gn_auth/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gn_auth/__init__.py b/gn_auth/__init__.py index aebc63b..55a51cc 100644 --- a/gn_auth/__init__.py +++ b/gn_auth/__init__.py @@ -2,6 +2,7 @@ import os import sys import logging +import warnings from pathlib import Path from typing import Optional, Callable @@ -18,9 +19,19 @@ from gn_auth.auth.authentication.oauth2.server import setup_oauth2_server from . import settings from .errors import register_error_handlers +## Configure warnings: ## +# https://docs.python.org/3/library/warnings.html#the-warnings-filter +# filters form: (action, message, category, module, lineno) +warnings.filters = [ + ("always", None, DeprecationWarning, None, 0) + # Add other filters here +] + warnings.filters + + class ConfigurationError(Exception): """Raised in case of a configuration error.""" + def check_mandatory_settings(app: Flask) -> None: """Verify that mandatory settings are defined in the application""" undefined = tuple( |