Skip to content

Commit

Permalink
Fix noisy tests (#1431)
Browse files Browse the repository at this point in the history
* Fixing noisy output for the template not found and directory not found tests
* Setting the logger back to its original state

Co-authored-by: Kevin DeJong <kddejong@amazon.com>
  • Loading branch information
Tro95 and kddejong authored Mar 19, 2020
1 parent 2f0f9de commit 58397f3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/unit/module/core/test_run_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@
class TestCli(BaseTestCase):
"""Test CLI processing """

def tearDown(self):
def setUp(self):
"""Setup"""
# Disable all but critical logger output, as both 'test_template_not_found' and
# 'test_template_not_found_directory' like to print out errors to the console.
logging.disable(logging.CRITICAL)

def tearDown(self):
"""Tear Down"""
logging.disable(logging.NOTSET)
for handler in LOGGER.handlers:
LOGGER.removeHandler(handler)

Expand All @@ -27,7 +34,7 @@ def test_template_not_found(self):
filename = 'test/fixtures/templates/good/core/not_found.yaml'

(args, filenames, _) = cfnlint.core.get_args_filenames(
['--template', filename, '--ignore_bad_template'])
['--template', filename, '--ignore-bad-template'])
(_, _, matches) = cfnlint.core.get_template_rules(filenames[0], args)

self.assertEqual(len(matches), 1)
Expand All @@ -38,7 +45,7 @@ def test_template_not_found_directory(self):
filename = 'test/fixtures/templates/good/core'

(args, filenames, _) = cfnlint.core.get_args_filenames(
['--template', filename, '--ignore_bad_template'])
['--template', filename, '--ignore-bad-template'])
(_, _, matches) = cfnlint.core.get_template_rules(filenames[0], args)

self.assertEqual(len(matches), 1)
Expand Down

0 comments on commit 58397f3

Please sign in to comment.