We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f68f012 commit e909591Copy full SHA for e909591
tests/panels/test_logging.py
@@ -1,4 +1,5 @@
1
import logging
2
+from unittest.mock import patch
3
4
from debug_toolbar.panels.logging import (
5
MESSAGE_IF_STRING_REPRESENTATION_INVALID,
@@ -86,3 +87,10 @@ def view(request):
86
87
self.assertEqual(
88
MESSAGE_IF_STRING_REPRESENTATION_INVALID, records[0]["message"]
89
)
90
+
91
+ @patch("sys.stderr")
92
+ def test_fallback_logging(self, mock_stderr):
93
+ # make sure the log reaches stderr even though logging set up
94
+ # its own handler during its import
95
+ self.logger.warning("hello")
96
+ mock_stderr.write.assert_called_once_with("hello\n")
0 commit comments