trivial: fix pointless-statement pylint warning (#52732)
This commit is contained in:
parent
e35c293dcb
commit
7a9657c293
|
@ -34,7 +34,6 @@ disable=
|
||||||
non-parent-init-called,
|
non-parent-init-called,
|
||||||
not-a-mapping,
|
not-a-mapping,
|
||||||
not-callable,
|
not-callable,
|
||||||
pointless-statement,
|
|
||||||
possibly-unused-variable,
|
possibly-unused-variable,
|
||||||
protected-access,
|
protected-access,
|
||||||
raise-missing-from,
|
raise-missing-from,
|
||||||
|
|
|
@ -860,6 +860,7 @@ def test_lazy_formdata_workflow_data(pub):
|
||||||
|
|
||||||
assert 'form_workflow_data__markers_stack' not in context.get_flat_keys()
|
assert 'form_workflow_data__markers_stack' not in context.get_flat_keys()
|
||||||
with pytest.raises(KeyError):
|
with pytest.raises(KeyError):
|
||||||
|
# noqa pylint: disable=pointless-statement
|
||||||
context['form_workflow_data__markers_stack']
|
context['form_workflow_data__markers_stack']
|
||||||
|
|
||||||
|
|
||||||
|
@ -932,9 +933,11 @@ def test_lazy_formdata_live_item(pub):
|
||||||
get_by_urlname.side_effect = KeyError
|
get_by_urlname.side_effect = KeyError
|
||||||
|
|
||||||
with pytest.raises(KeyError):
|
with pytest.raises(KeyError):
|
||||||
|
# noqa pylint: disable=pointless-statement
|
||||||
context['form_var_foo_live_name']
|
context['form_var_foo_live_name']
|
||||||
assert get_by_urlname.call_count == 1
|
assert get_by_urlname.call_count == 1
|
||||||
with pytest.raises(KeyError): # repeated access, will go through cache
|
with pytest.raises(KeyError): # repeated access, will go through cache
|
||||||
|
# noqa pylint: disable=pointless-statement
|
||||||
context['form_var_foo_live_name']
|
context['form_var_foo_live_name']
|
||||||
assert get_by_urlname.call_count == 1
|
assert get_by_urlname.call_count == 1
|
||||||
assert 'form_var_foo_live_var_attr' not in context.get_flat_keys()
|
assert 'form_var_foo_live_var_attr' not in context.get_flat_keys()
|
||||||
|
@ -996,6 +999,7 @@ def test_lazy_formdata_queryset(pub, variable_test_data):
|
||||||
# (see code for explanation)
|
# (see code for explanation)
|
||||||
manager = lazy_formdata.objects
|
manager = lazy_formdata.objects
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
|
# noqa pylint: disable=pointless-statement
|
||||||
manager['drafts']
|
manager['drafts']
|
||||||
assert manager._cached_resultset is None
|
assert manager._cached_resultset is None
|
||||||
|
|
||||||
|
@ -1488,6 +1492,7 @@ def test_lazy_variables(pub, variable_test_data):
|
||||||
assert context['form_display_name'] == formdata.get_display_name()
|
assert context['form_display_name'] == formdata.get_display_name()
|
||||||
assert context['form_var_foo_foo'] == 'bar'
|
assert context['form_var_foo_foo'] == 'bar'
|
||||||
with pytest.raises(KeyError):
|
with pytest.raises(KeyError):
|
||||||
|
# noqa pylint: disable=pointless-statement
|
||||||
context['form_var_xxx']
|
context['form_var_xxx']
|
||||||
assert 'bar' in context['form_var_foo_foo']
|
assert 'bar' in context['form_var_foo_foo']
|
||||||
assert context['form_var_foo_foo'] + 'ab' == 'barab'
|
assert context['form_var_foo_foo'] + 'ab' == 'barab'
|
||||||
|
|
|
@ -580,7 +580,6 @@ def test_pickle_2to3_conversion(pub):
|
||||||
formdef.fields = [
|
formdef.fields = [
|
||||||
StringField(id='1', label='Test', type='string', varname='foo'),
|
StringField(id='1', label='Test', type='string', varname='foo'),
|
||||||
]
|
]
|
||||||
formdef.roles
|
|
||||||
formdef.store()
|
formdef.store()
|
||||||
|
|
||||||
formdef_id = formdef.id
|
formdef_id = formdef.id
|
||||||
|
|
|
@ -89,4 +89,5 @@ def test_user_formdef_getattr():
|
||||||
assert user.get_formdef != 'Foo'
|
assert user.get_formdef != 'Foo'
|
||||||
|
|
||||||
with pytest.raises(AttributeError):
|
with pytest.raises(AttributeError):
|
||||||
|
# noqa pylint: disable=pointless-statement
|
||||||
user.xxx
|
user.xxx
|
||||||
|
|
Loading…
Reference in New Issue