From 8fde84f130e32d343b7f1758ee7c43f27f0bb545 Mon Sep 17 00:00:00 2001 From: Federico Fapitalle Date: Wed, 11 Dec 2019 10:30:18 -0300 Subject: [PATCH] Adds test for no-warnings and strict mode --- tests/test_cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index d08f640..014cf8f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -533,7 +533,7 @@ class CommandLineTestCase(unittest.TestCase): 'mapping values are not allowed here\n')) self.assertEqual(err, '') - def test_run_supress_warnings(self): + def test_run_no_warnings(self): file = os.path.join(self.wd, 'a.yaml') sys.stdout, sys.stderr = StringIO(), StringIO() @@ -558,3 +558,12 @@ class CommandLineTestCase(unittest.TestCase): cli.run((file, '--no-warnings', '-f', 'auto')) self.assertEqual(ctx.exception.code, 0) + + def test_run_no_warnings_and_strict(self): + file = os.path.join(self.wd, 'warn.yaml') + + sys.stdout, sys.stderr = StringIO(), StringIO() + with self.assertRaises(SystemExit) as ctx: + cli.run((file, '--no-warnings', '-s')) + + self.assertEqual(ctx.exception.code, 2)