Adding a "does not raise" test for displaying errors.

This commit is contained in:
Dan Helfman 2017-07-09 10:27:34 -07:00
parent e50fd04750
commit a16d90ff46
2 changed files with 8 additions and 1 deletions

View file

@ -59,7 +59,7 @@ def parse_configuration(config_filename, schema_filename):
return parsed_result
def display_validation_error(validation_error): # pragma: no cover
def display_validation_error(validation_error):
'''
Given a Validation_error, display its error messages to stderr.
'''

View file

@ -111,3 +111,10 @@ def test_parse_configuration_raises_for_validation_error():
with pytest.raises(module.Validation_error):
module.parse_configuration('config.yaml', 'schema.yaml')
def test_display_validation_error_does_not_raise():
flexmock(sys.modules['builtins']).should_receive('print')
error = module.Validation_error('config.yaml', ('oops', 'uh oh'))
module.display_validation_error(error)