mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 07:44:16 +00:00
Update tests for errors with no physical line
This commit is contained in:
parent
57e82688df
commit
e977c6671a
1 changed files with 9 additions and 1 deletions
|
|
@ -51,7 +51,15 @@ def test_show_source_returns_nothing_when_not_showing_source():
|
||||||
formatter = base.BaseFormatter(options(show_source=False))
|
formatter = base.BaseFormatter(options(show_source=False))
|
||||||
assert formatter.show_source(
|
assert formatter.show_source(
|
||||||
style_guide.Error('A000', 'file.py', 1, 1, 'error text', 'line')
|
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', [
|
@pytest.mark.parametrize('line, column', [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue