Skip to content

Commit

Permalink
coverage: add log level config coverage (#986)
Browse files Browse the repository at this point in the history
* tests: add log level config coverage

* apply comments
  • Loading branch information
Kludex authored Mar 14, 2021
1 parent 862e774 commit bf1c64e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bf1c64e

Please sign in to comment.