From 0de40e8e191469127668158fb483f8020ad93ccd Mon Sep 17 00:00:00 2001 From: Arnav Kumar Date: Mon, 25 Jan 2016 12:09:45 +0800 Subject: [PATCH] Add test for excluding loggers during setup with Flask --- tests/contrib/flask/tests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/contrib/flask/tests.py b/tests/contrib/flask/tests.py index 072cec80..dd0df263 100644 --- a/tests/contrib/flask/tests.py +++ b/tests/contrib/flask/tests.py @@ -263,6 +263,19 @@ class FlaskTest(BaseTest): assert self.middleware.last_event_id == event_id assert g.sentry_event_id == event_id + def test_logging_setup_with_exclusion_list(self): + app = Flask(__name__) + raven = TempStoreClient() + + Sentry(app, client=raven, logging=True, + logging_exclusions=("excluded_logger",)) + + excluded_logger = logging.getLogger("excluded_logger") + self.assertFalse(excluded_logger.propagate) + + some_other_logger = logging.getLogger("some_other_logger") + self.assertTrue(some_other_logger.propagate) + class FlaskLoginTest(BaseTest):