pylint: Disable pointless-statement in tests
This commit is contained in:
parent
5ce8a9c9c1
commit
c07b93b7c4
|
|
@ -58,6 +58,7 @@ def main():
|
|||
'protected-access',
|
||||
'len-as-condition',
|
||||
'compare-to-empty-string',
|
||||
'pointless-statement',
|
||||
# directories without __init__.py...
|
||||
'import-error',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -488,12 +488,11 @@ class TestCompletionMetaInfo:
|
|||
|
||||
def test_contains_keyerror(self, metainfo):
|
||||
with pytest.raises(KeyError):
|
||||
# pylint: disable=pointless-statement
|
||||
'does_not_exist' in metainfo # noqa: B015
|
||||
|
||||
def test_getitem_keyerror(self, metainfo):
|
||||
with pytest.raises(KeyError):
|
||||
metainfo['does_not_exist'] # pylint: disable=pointless-statement
|
||||
metainfo['does_not_exist']
|
||||
|
||||
def test_setitem_keyerror(self, metainfo):
|
||||
with pytest.raises(KeyError):
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ class TestWebKitElement:
|
|||
|
||||
def test_getitem_keyerror(self, elem):
|
||||
with pytest.raises(KeyError):
|
||||
elem['foo'] # pylint: disable=pointless-statement
|
||||
elem['foo']
|
||||
|
||||
def test_setitem(self, elem):
|
||||
elem['foo'] = 'bar'
|
||||
|
|
|
|||
|
|
@ -725,7 +725,7 @@ class TestContainer:
|
|||
def test_getattr_invalid_private(self, container):
|
||||
"""Make sure an invalid _attribute doesn't try getting a container."""
|
||||
with pytest.raises(AttributeError):
|
||||
container._foo # pylint: disable=pointless-statement
|
||||
container._foo
|
||||
|
||||
def test_getattr_prefix(self, container):
|
||||
new_container = container.tabs
|
||||
|
|
@ -744,7 +744,7 @@ class TestContainer:
|
|||
|
||||
def test_getattr_invalid(self, container):
|
||||
with pytest.raises(configexc.NoOptionError) as excinfo:
|
||||
container.tabs.foobar # pylint: disable=pointless-statement
|
||||
container.tabs.foobar
|
||||
assert excinfo.value.option == 'tabs.foobar'
|
||||
|
||||
def test_setattr_option(self, config_stub, container):
|
||||
|
|
@ -754,7 +754,7 @@ class TestContainer:
|
|||
def test_confapi_errors(self, container):
|
||||
configapi = types.SimpleNamespace(errors=[])
|
||||
container._configapi = configapi
|
||||
container.tabs.foobar # pylint: disable=pointless-statement
|
||||
container.tabs.foobar
|
||||
|
||||
assert len(configapi.errors) == 1
|
||||
error = configapi.errors[0]
|
||||
|
|
|
|||
|
|
@ -55,12 +55,10 @@ def test_configcache_get_after_set(config_stub):
|
|||
def test_configcache_naive_benchmark(config_stub, benchmark):
|
||||
def _run_bench():
|
||||
for _i in range(10000):
|
||||
# pylint: disable=pointless-statement
|
||||
config.cache['tabs.padding']
|
||||
config.cache['tabs.indicator.width']
|
||||
config.cache['tabs.indicator.padding']
|
||||
config.cache['tabs.min_width']
|
||||
config.cache['tabs.max_width']
|
||||
config.cache['tabs.pinned.shrink']
|
||||
# pylint: enable=pointless-statement
|
||||
benchmark(_run_bench)
|
||||
|
|
|
|||
Loading…
Reference in New Issue