diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-06-11 11:39:05 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-06-11 11:39:05 +0200 |
commit | a9d10aee8403fdfcfc68d38a40312c7811d0dfe7 (patch) | |
tree | a9e20c467ebec03d478810c194cf50dd334cbbd3 /tests/unit/utils/test_log.py | |
parent | 23b5ee977714a56f64f2d9059dea050de504863d (diff) | |
download | qutebrowser-a9d10aee8403fdfcfc68d38a40312c7811d0dfe7.tar.gz qutebrowser-a9d10aee8403fdfcfc68d38a40312c7811d0dfe7.zip |
tests: Separate init_from_config logs in utils.test_log
Diffstat (limited to 'tests/unit/utils/test_log.py')
-rw-r--r-- | tests/unit/utils/test_log.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unit/utils/test_log.py b/tests/unit/utils/test_log.py index 6b770ed44..3e3243e48 100644 --- a/tests/unit/utils/test_log.py +++ b/tests/unit/utils/test_log.py @@ -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) |