summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2017-05-27 19:22:38 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2017-05-27 19:22:38 -0500
commit2baaf00e83073a749238798983de4b8161e3e328 (patch)
treeb385062c83f3a2f81acb93586b8cfb93a38a0c83 /tests
parentd890b8b6833689aa0a67abb8f406082f4dd8ad81 (diff)
downloadflake8-2baaf00e83073a749238798983de4b8161e3e328.tar.gz
Further refine our logic handling selection
There was a *very* subtle bug in how we handle blanket select statements with error codes that are in our DEFAULT_IGNORE. In the specific case, users were specifying ``--select E`` and E126 was not being properly reported. This unveiled further logic bugs as we refined this. Closes #318
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_style_guide.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/unit/test_style_guide.py b/tests/unit/test_style_guide.py
index 7357b25..10550f8 100644
--- a/tests/unit/test_style_guide.py
+++ b/tests/unit/test_style_guide.py
@@ -125,6 +125,9 @@ def test_is_user_selected_excludes_errors(select_list, error_code):
(['E41'], ['E2', 'E12', 'E4'], 'E410', style_guide.Decision.Selected),
(['E'], ['F'], 'E410', style_guide.Decision.Selected),
(['F'], [], 'E410', style_guide.Decision.Ignored),
+ (['E'], defaults.IGNORE, 'E126', style_guide.Decision.Selected),
+ (['W'], defaults.IGNORE, 'E126', style_guide.Decision.Ignored),
+ (['E'], defaults.IGNORE, 'W391', style_guide.Decision.Ignored),
])
def test_should_report_error(select_list, ignore_list, error_code, expected):
"""Verify we decide when to report an error."""
@@ -141,7 +144,7 @@ def test_should_report_error(select_list, ignore_list, error_code, expected):
(defaults.SELECT, [], ['I1'], [], 'I100',
style_guide.Decision.Selected),
(defaults.SELECT, [], ['I1'], [], 'I201',
- style_guide.Decision.Selected),
+ style_guide.Decision.Ignored),
(defaults.SELECT, ['I2'], ['I1'], [], 'I101',
style_guide.Decision.Selected),
(defaults.SELECT, ['I2'], ['I1'], [], 'I201',