mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-13 16:14:18 +00:00
Update our linecache test to correct it
This commit is contained in:
parent
467672fc5c
commit
15043a4ab7
1 changed files with 3 additions and 1 deletions
|
|
@ -135,7 +135,9 @@ def test_is_inline_ignored(error_code, physical_line, expected_result):
|
||||||
listener_trie=None,
|
listener_trie=None,
|
||||||
formatter=None)
|
formatter=None)
|
||||||
error = style_guide.Error(error_code, 'filename.py', 1, 1, 'error text',
|
error = style_guide.Error(error_code, 'filename.py', 1, 1, 'error text',
|
||||||
physical_line)
|
None)
|
||||||
|
# We want `None` to be passed as the physical line so we actually use our
|
||||||
|
# monkey-patched linecache.getline value.
|
||||||
|
|
||||||
with mock.patch('linecache.getline', return_value=physical_line):
|
with mock.patch('linecache.getline', return_value=physical_line):
|
||||||
assert guide.is_inline_ignored(error) is expected_result
|
assert guide.is_inline_ignored(error) is expected_result
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue