mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 20:26:53 +00:00
Fix zero-indexed column numbering
We accidentally changed column numbering from one-indexed to zero-indexed.
This commit is contained in:
parent
ec6165e9d8
commit
6eca38f2f2
5 changed files with 11 additions and 4 deletions
|
|
@ -73,7 +73,7 @@ def test_show_source_updates_physical_line_appropriately(line, column):
|
|||
error = style_guide.Error('A000', 'file.py', 1, column, 'error', line)
|
||||
output = formatter.show_source(error)
|
||||
_, pointer = output.rsplit('\n', 1)
|
||||
assert pointer.count(' ') == column
|
||||
assert pointer.count(' ') == (column - 1)
|
||||
|
||||
|
||||
def test_write_uses_an_output_file():
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ def test_handle_error_notifies_listeners(select_list, ignore_list, error_code):
|
|||
formatter=formatter)
|
||||
|
||||
with mock.patch('linecache.getline', return_value=''):
|
||||
guide.handle_error(error_code, 'stdin', 1, 1, 'error found')
|
||||
guide.handle_error(error_code, 'stdin', 1, 0, 'error found')
|
||||
error = style_guide.Error(error_code, 'stdin', 1, 1, 'error found',
|
||||
None)
|
||||
listener_trie.notify.assert_called_once_with(error_code, error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue