Add test to verify no-warnings config option fails when not boolean

This commit is contained in:
Joel Baranick
2020-12-21 09:17:27 -08:00
parent cef89cf69f
commit 5de2fffd41

View File

@@ -38,6 +38,11 @@ class SimpleConfigTestCase(unittest.TestCase):
new = config.YamlLintConfig('no-warnings: true') new = config.YamlLintConfig('no-warnings: true')
self.assertTrue(new.no_warnings) 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): def test_parse_config(self):
new = config.YamlLintConfig('rules:\n' new = config.YamlLintConfig('rules:\n'
' colons:\n' ' colons:\n'