Update tests for errors with no physical line

This commit is contained in:
Ian Cordasco 2016-07-09 20:26:08 -05:00
parent 57e82688df
commit e977c6671a
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A

View file

@ -51,7 +51,15 @@ def test_show_source_returns_nothing_when_not_showing_source():
formatter = base.BaseFormatter(options(show_source=False))
assert formatter.show_source(
style_guide.Error('A000', 'file.py', 1, 1, 'error text', 'line')
) is None
) is ''
def test_show_source_returns_nothing_when_there_is_source():
"""Ensure we return nothing when there is no line."""
formatter = base.BaseFormatter(options(show_source=True))
assert formatter.show_source(
style_guide.Error('A000', 'file.py', 1, 1, 'error text', None)
) is ''
@pytest.mark.parametrize('line, column', [