mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 12:16:53 +00:00
Add pep8-naming to flake8 linting
This commit is contained in:
parent
a3a2539a23
commit
c60546e896
5 changed files with 13 additions and 12 deletions
|
|
@ -5,7 +5,7 @@ from flake8 import checker
|
|||
|
||||
|
||||
@mock.patch('flake8.processor.FileProcessor')
|
||||
def test_run_ast_checks_handles_SyntaxErrors(FileProcessor):
|
||||
def test_run_ast_checks_handles_SyntaxErrors(FileProcessor): # noqa: N802,N803
|
||||
"""Stress our SyntaxError handling.
|
||||
|
||||
Related to: https://gitlab.com/pycqa/flake8/issues/237
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ def test_to_optparse():
|
|||
|
||||
|
||||
@mock.patch('optparse.Option')
|
||||
def test_to_optparse_creates_an_option_as_we_expect(Option):
|
||||
def test_to_optparse_creates_an_option_as_we_expect(Option): # noqa: N803
|
||||
"""Show that we pass all keyword args to optparse.Option."""
|
||||
opt = manager.Option('-t', '--test', action='count')
|
||||
opt.to_optparse()
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class FakeTestType(manager.PluginTypeManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_instantiates_a_manager(PluginManager):
|
||||
def test_instantiates_a_manager(PluginManager): # noqa: N803
|
||||
"""Verify we create a PluginManager on instantiation."""
|
||||
FakeTestType()
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ def test_instantiates_a_manager(PluginManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_proxies_names_to_manager(PluginManager):
|
||||
def test_proxies_names_to_manager(PluginManager): # noqa: N803
|
||||
"""Verify we proxy the names attribute."""
|
||||
PluginManager.return_value = mock.Mock(names=[
|
||||
'T100', 'T200', 'T300'
|
||||
|
|
@ -68,7 +68,7 @@ def test_proxies_names_to_manager(PluginManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_proxies_plugins_to_manager(PluginManager):
|
||||
def test_proxies_plugins_to_manager(PluginManager): # noqa: N803
|
||||
"""Verify we proxy the plugins attribute."""
|
||||
PluginManager.return_value = mock.Mock(plugins=[
|
||||
'T100', 'T200', 'T300'
|
||||
|
|
@ -91,7 +91,7 @@ def test_generate_call_function():
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_load_plugins(PluginManager):
|
||||
def test_load_plugins(PluginManager): # noqa: N803
|
||||
"""Verify load plugins loads *every* plugin."""
|
||||
# Create a bunch of fake plugins
|
||||
plugins = [create_plugin_mock(), create_plugin_mock(),
|
||||
|
|
@ -111,7 +111,7 @@ def test_load_plugins(PluginManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_load_plugins_fails(PluginManager):
|
||||
def test_load_plugins_fails(PluginManager): # noqa: N803
|
||||
"""Verify load plugins bubbles up exceptions."""
|
||||
plugins = [create_plugin_mock(), create_plugin_mock(True),
|
||||
create_plugin_mock(), create_plugin_mock(),
|
||||
|
|
@ -135,7 +135,7 @@ def test_load_plugins_fails(PluginManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_register_options(PluginManager):
|
||||
def test_register_options(PluginManager): # noqa: N803
|
||||
"""Test that we map over every plugin to register options."""
|
||||
plugins = [create_plugin_mock(), create_plugin_mock(),
|
||||
create_plugin_mock(), create_plugin_mock(),
|
||||
|
|
@ -153,7 +153,7 @@ def test_register_options(PluginManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_provide_options(PluginManager):
|
||||
def test_provide_options(PluginManager): # noqa: N803
|
||||
"""Test that we map over every plugin to provide parsed options."""
|
||||
plugins = [create_plugin_mock(), create_plugin_mock(),
|
||||
create_plugin_mock(), create_plugin_mock(),
|
||||
|
|
@ -175,7 +175,7 @@ def test_provide_options(PluginManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_proxy_contains_to_managers_plugins_dict(PluginManager):
|
||||
def test_proxy_contains_to_managers_plugins_dict(PluginManager): # noqa: N803
|
||||
"""Verify that we proxy __contains__ to the manager's dictionary."""
|
||||
plugins = {'T10%i' % i: create_plugin_mock() for i in range(8)}
|
||||
# Return our PluginManager mock
|
||||
|
|
@ -188,7 +188,7 @@ def test_proxy_contains_to_managers_plugins_dict(PluginManager):
|
|||
|
||||
|
||||
@mock.patch('flake8.plugins.manager.PluginManager')
|
||||
def test_proxies_getitem_to_managers_plugins_dictionary(PluginManager):
|
||||
def test_proxies_getitem_to_managers_plugins_dict(PluginManager): # noqa: N803
|
||||
"""Verify that we can use the PluginTypeManager like a dictionary."""
|
||||
plugins = {'T10%i' % i: create_plugin_mock() for i in range(8)}
|
||||
# Return our PluginManager mock
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class TestTrieNode(object):
|
|||
assert child.prefix == 'a'
|
||||
assert child.data == 'a is for Apple'
|
||||
|
||||
def test_find_prefix_returns_None_when_no_children_have_the_prefix(self):
|
||||
def test_find_prefix_returns_none_when_no_children_have_the_prefix(self):
|
||||
"""Verify we receive None from find_prefix for missing children."""
|
||||
node = trie.TrieNode('E', 'E is for Eat', children={
|
||||
'a': trie.TrieNode('a', 'a is for Apple')
|
||||
|
|
|
|||
1
tox.ini
1
tox.ini
|
|
@ -37,6 +37,7 @@ deps =
|
|||
flake8
|
||||
flake8-docstrings>=0.2.7
|
||||
flake8-import-order>=0.9
|
||||
pep8-naming
|
||||
commands =
|
||||
flake8 src/flake8/ tests/ setup.py
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue