mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 18:46:52 +00:00
Merge branch '405-ImportStarUsage' into 'master'
pyflakes ImportStarUsage => flake8 405 patch See merge request !56
This commit is contained in:
commit
d425c246d0
3 changed files with 8 additions and 4 deletions
|
|
@ -34,6 +34,8 @@ PyFlakes messages to add the following codes:
|
|||
+------+--------------------------------------------------------------------+
|
||||
| F404 | future import(s) ``name`` after other statements |
|
||||
+------+--------------------------------------------------------------------+
|
||||
| F405 | ``name`` may be undefined, or defined from star imports: ``module``|
|
||||
+------+--------------------------------------------------------------------+
|
||||
+------+--------------------------------------------------------------------+
|
||||
| F811 | redefinition of unused ``name`` from line ``N`` |
|
||||
+------+--------------------------------------------------------------------+
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ def patch_pyflakes():
|
|||
'F402 ImportShadowedByLoopVar',
|
||||
'F403 ImportStarUsed',
|
||||
'F404 LateFutureImport',
|
||||
'F405 ImportStarUsage',
|
||||
'F810 Redefined', # XXX Obsolete?
|
||||
'F811 RedefinedWhileUnused',
|
||||
'F812 RedefinedInListComp',
|
||||
|
|
|
|||
|
|
@ -79,19 +79,19 @@ class TestOptionSerializerParsesLists(unittest.TestCase):
|
|||
def setUp(self):
|
||||
self.option = optparse.Option('--select')
|
||||
self.option_name = 'select'
|
||||
self.answer = ['F401', 'F402', 'F403', 'F404']
|
||||
self.answer = ['F401', 'F402', 'F403', 'F404', 'F405']
|
||||
|
||||
def test_parses_simple_comma_separated_lists(self):
|
||||
value = option_normalizer('F401,F402,F403,F404', self.option,
|
||||
value = option_normalizer('F401,F402,F403,F404,F405', self.option,
|
||||
self.option_name)
|
||||
self.assertEqual(value, self.answer)
|
||||
|
||||
def test_parses_less_simple_comma_separated_lists(self):
|
||||
value = option_normalizer('F401 ,F402 ,F403 ,F404', self.option,
|
||||
value = option_normalizer('F401 ,F402 ,F403 ,F404, F405', self.option,
|
||||
self.option_name)
|
||||
self.assertEqual(value, self.answer)
|
||||
|
||||
value = option_normalizer('F401, F402, F403, F404', self.option,
|
||||
value = option_normalizer('F401, F402, F403, F404, F405', self.option,
|
||||
self.option_name)
|
||||
self.assertEqual(value, self.answer)
|
||||
|
||||
|
|
@ -101,6 +101,7 @@ class TestOptionSerializerParsesLists(unittest.TestCase):
|
|||
F402,
|
||||
F403,
|
||||
F404,
|
||||
F405,
|
||||
''', self.option, self.option_name)
|
||||
self.assertEqual(value, self.answer)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue