diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-26 19:15:08 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-26 19:45:05 -0500 |
| commit | 6eca38f2f2a15765aecef010f878aa17fdbe1db7 (patch) | |
| tree | c209a7a9463df7c6173a74319b1f48a8d1744d3b /tests | |
| parent | ec6165e9d86b8ea88bfe713bad282a8188403575 (diff) | |
| download | flake8-6eca38f2f2a15765aecef010f878aa17fdbe1db7.tar.gz | |
Fix zero-indexed column numbering
We accidentally changed column numbering from one-indexed to
zero-indexed.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_base_formatter.py | 2 | ||||
| -rw-r--r-- | tests/unit/test_style_guide.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/test_base_formatter.py b/tests/unit/test_base_formatter.py index f148806..ae5c12a 100644 --- a/tests/unit/test_base_formatter.py +++ b/tests/unit/test_base_formatter.py @@ -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(): diff --git a/tests/unit/test_style_guide.py b/tests/unit/test_style_guide.py index a38c657..4efbca5 100644 --- a/tests/unit/test_style_guide.py +++ b/tests/unit/test_style_guide.py @@ -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) |
