Adding a "does not raise" test for displaying errors.
This commit is contained in:
parent
e50fd04750
commit
a16d90ff46
2 changed files with 8 additions and 1 deletions
|
@ -59,7 +59,7 @@ def parse_configuration(config_filename, schema_filename):
|
||||||
return parsed_result
|
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.
|
Given a Validation_error, display its error messages to stderr.
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -111,3 +111,10 @@ def test_parse_configuration_raises_for_validation_error():
|
||||||
|
|
||||||
with pytest.raises(module.Validation_error):
|
with pytest.raises(module.Validation_error):
|
||||||
module.parse_configuration('config.yaml', 'schema.yaml')
|
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)
|
||||||
|
|
Loading…
Reference in a new issue