From bf1c64e2c141971c546671c7dc91b8ccf0afeb7d Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Sun, 14 Mar 2021 10:20:08 -0700 Subject: [PATCH] coverage: add log level config coverage (#986) * tests: add log level config coverage * apply comments --- tests/test_config.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 57078146a..22819cb38 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -262,3 +262,14 @@ def test_config_access_log(access_log: bool, handlers: int): assert len(logging.getLogger("uvicorn.access").handlers) == handlers assert config.access_log == access_log + + +@pytest.mark.parametrize("log_level", [5, 10, 20, 30, 40, 50]) +def test_config_log_level(log_level): + config = Config(app=asgi_app, log_level=log_level) + config.load() + + assert logging.getLogger("uvicorn.error").level == log_level + assert logging.getLogger("uvicorn.access").level == log_level + assert logging.getLogger("uvicorn.asgi").level == log_level + assert config.log_level == log_level