Merge branch 'bug/67' into 'master'

Remove enabled extensions from `options.select`

When taking advantage of the --select flag for off-by-default
extensions, we neglected to take into account the fact that leaving the
extension names in the select list would cause different behaviour in
pep8. This should remedy this.

Related to GitLab bug #67

----

cc @joe-gordon0

See merge request !37
This commit is contained in:
Ian Cordasco 2015-09-28 01:32:11 +00:00
commit bf19122741
2 changed files with 39 additions and 1 deletions

View file

@ -56,6 +56,18 @@ class TestEngine(unittest.TestCase):
self.assertTrue(isinstance(i, list))
self.assertTrue(register_check.called)
def test_disable_extensions(self):
parser = mock.MagicMock()
options = mock.MagicMock()
parser.ignored_extensions = ['I123', 'I345', 'I678', 'I910']
options.enabled_extensions = 'I345,\nI678,I910'
options.ignore = ('E121', 'E123')
engine._disable_extensions(parser, options)
self.assertEqual(set(options.ignore), set(['E121', 'E123', 'I123']))
def test_get_parser(self):
# setup
re = self.start_patch('flake8.engine._register_extensions')