Merge pull request #7441 from tk0miya/7423_logging_non_string_object

Fix #7423: crashed when giving a non-string object to logger
This commit is contained in:
Takeshi KOMIYA authored and GitHub committed 2020-04-10 00:16:46 +09:00
commit 9002b6c9ec
3 files changed
+10 -1

No files matched your search

+8
View File
@@ -48,6 +48,14 @@ def test_info_and_warning(app, status, warning):
assert 'message5' in warning.getvalue()
def test_Exception(app, status, warning):
logging.setup(app, status, warning)
logger = logging.getLogger(__name__)
logger.info(Exception)
assert "<class 'Exception'>" in status.getvalue()
def test_verbosity_filter(app, status, warning):
# verbosity = 0: INFO
app.verbosity = 0