From 5de2fffd414fe87726ac71fed104d8897d55acbc Mon Sep 17 00:00:00 2001 From: Joel Baranick Date: Mon, 21 Dec 2020 09:17:27 -0800 Subject: [PATCH] Add test to verify no-warnings config option fails when not boolean --- tests/test_config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 23d905c..039bb05 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -38,6 +38,11 @@ class SimpleConfigTestCase(unittest.TestCase): new = config.YamlLintConfig('no-warnings: true') self.assertTrue(new.no_warnings) + with self.assertRaisesRegex( + config.YamlLintConfigError, + 'invalid config: no-warnings should be a bool'): + config.YamlLintConfig('no-warnings: foobar') + def test_parse_config(self): new = config.YamlLintConfig('rules:\n' ' colons:\n'