From 7a9657c2936207daf34d4f7d2d0cd4f8b29c0f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 2 Apr 2021 22:47:22 +0200 Subject: [PATCH] trivial: fix pointless-statement pylint warning (#52732) --- pylint.rc | 1 - tests/test_formdata.py | 5 +++++ tests/test_formdef.py | 1 - tests/test_users.py | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pylint.rc b/pylint.rc index e25971389..2a920e83c 100644 --- a/pylint.rc +++ b/pylint.rc @@ -34,7 +34,6 @@ disable= non-parent-init-called, not-a-mapping, not-callable, - pointless-statement, possibly-unused-variable, protected-access, raise-missing-from, diff --git a/tests/test_formdata.py b/tests/test_formdata.py index 980f12045..204b38efb 100644 --- a/tests/test_formdata.py +++ b/tests/test_formdata.py @@ -860,6 +860,7 @@ def test_lazy_formdata_workflow_data(pub): assert 'form_workflow_data__markers_stack' not in context.get_flat_keys() with pytest.raises(KeyError): + # noqa pylint: disable=pointless-statement context['form_workflow_data__markers_stack'] @@ -932,9 +933,11 @@ def test_lazy_formdata_live_item(pub): get_by_urlname.side_effect = KeyError with pytest.raises(KeyError): + # noqa pylint: disable=pointless-statement context['form_var_foo_live_name'] assert get_by_urlname.call_count == 1 with pytest.raises(KeyError): # repeated access, will go through cache + # noqa pylint: disable=pointless-statement context['form_var_foo_live_name'] assert get_by_urlname.call_count == 1 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) manager = lazy_formdata.objects with pytest.raises(TypeError): + # noqa pylint: disable=pointless-statement manager['drafts'] 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_var_foo_foo'] == 'bar' with pytest.raises(KeyError): + # noqa pylint: disable=pointless-statement context['form_var_xxx'] assert 'bar' in context['form_var_foo_foo'] assert context['form_var_foo_foo'] + 'ab' == 'barab' diff --git a/tests/test_formdef.py b/tests/test_formdef.py index ef8318347..47c1132b9 100644 --- a/tests/test_formdef.py +++ b/tests/test_formdef.py @@ -580,7 +580,6 @@ def test_pickle_2to3_conversion(pub): formdef.fields = [ StringField(id='1', label='Test', type='string', varname='foo'), ] - formdef.roles formdef.store() formdef_id = formdef.id diff --git a/tests/test_users.py b/tests/test_users.py index ab5b72a24..48bbceaf9 100644 --- a/tests/test_users.py +++ b/tests/test_users.py @@ -89,4 +89,5 @@ def test_user_formdef_getattr(): assert user.get_formdef != 'Foo' with pytest.raises(AttributeError): + # noqa pylint: disable=pointless-statement user.xxx