tests: Separate init_from_config logs in utils.test_log
This commit is contained in:
parent
23b5ee9777
commit
a9d10aee84
|
|
@ -255,14 +255,16 @@ class TestInitLog:
|
|||
with pytest.raises(PendingDeprecationWarning):
|
||||
warnings.warn("test warning", PendingDeprecationWarning)
|
||||
|
||||
|
||||
class TestInitFromConfig:
|
||||
|
||||
@pytest.mark.parametrize('cli, conf, expected', [
|
||||
(None, 'info', logging.INFO),
|
||||
(None, 'warning', logging.WARNING),
|
||||
('info', 'warning', logging.INFO),
|
||||
('warning', 'info', logging.WARNING),
|
||||
])
|
||||
def test_init_from_config_console(self, cli, conf, expected, args,
|
||||
config_stub):
|
||||
def test_console(self, cli, conf, expected, args, config_stub):
|
||||
args.debug = False
|
||||
args.loglevel = cli
|
||||
log.init_log(args)
|
||||
|
|
@ -277,7 +279,7 @@ class TestInitLog:
|
|||
('info', logging.INFO),
|
||||
('critical', logging.CRITICAL),
|
||||
])
|
||||
def test_init_from_config_ram(self, conf, expected, args, config_stub):
|
||||
def test_ram(self, conf, expected, args, config_stub):
|
||||
args.debug = False
|
||||
log.init_log(args)
|
||||
|
||||
|
|
@ -285,7 +287,7 @@ class TestInitLog:
|
|||
log.init_from_config(config_stub.val)
|
||||
assert log.ram_handler.level == expected
|
||||
|
||||
def test_init_from_config_consistent_default(self, config_stub):
|
||||
def test_consistent_default(self, config_stub):
|
||||
"""Ensure config defaults are consistent with the builtin defaults."""
|
||||
args = qutebrowser.get_argparser().parse_args([])
|
||||
log.init_log(args)
|
||||
|
|
|
|||
Loading…
Reference in New Issue