We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6222e2 commit 1f016f8Copy full SHA for 1f016f8
tests/functional/test_logger.py
@@ -333,3 +333,14 @@ def test_logger_level_as_int():
333
334
# THEN we should be expected int (20, in this case)
335
assert logger.level == logging.INFO
336
+
337
338
+def test_logger_level_env_var_as_int(monkeypatch):
339
+ # GIVEN Logger is initialized
340
+ # WHEN log level is explicitly defined via LOG_LEVEL env as int
341
+ # THEN Logger should propagate ValueError
342
+ # since env vars can only be string
343
+ # and '50' is not a correct log level
344
+ monkeypatch.setenv("LOG_LEVEL", 50)
345
+ with pytest.raises(ValueError, match="Unknown level: '50'"):
346
+ Logger()
0 commit comments