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

pull/348/head
Joel Baranick 4 years ago
parent cef89cf69f
commit 5de2fffd41

@ -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'

Loading…
Cancel
Save