mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
pylint: Fix useless-suppression
Cleanup up no longer used Pylint's disables where possible. Fixes: https://pagure.io/freeipa/issue/9117 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
ac6fe016c6
commit
5a00882eab
@@ -34,7 +34,7 @@ IPA_TESTS_ENV_DIR = os.path.join(IPA_TESTS_ENV_WORKING_DIR, IPA_TESTS_ENV_NAME)
|
||||
IPA_TEST_CONFIG = "ipa-test-config.yaml"
|
||||
|
||||
|
||||
class ExecRunReturn(NamedTuple): # pylint: disable=inherit-non-class #3876
|
||||
class ExecRunReturn(NamedTuple):
|
||||
exit_code: int
|
||||
output: Tuple[bytes, bytes]
|
||||
|
||||
|
||||
@@ -151,11 +151,9 @@ def pytest_cmdline_main(config):
|
||||
def pytest_runtest_setup(item):
|
||||
if isinstance(item, pytest.Function):
|
||||
if item.get_closest_marker('skip_ipaclient_unittest'):
|
||||
# pylint: disable=no-member
|
||||
if item.config.option.ipaclient_unittests:
|
||||
pytest.skip("Skip in ipaclient unittest mode")
|
||||
if item.get_closest_marker('needs_ipaapi'):
|
||||
# pylint: disable=no-member
|
||||
if item.config.option.skip_ipaapi:
|
||||
pytest.skip("Skip tests that needs an IPA API")
|
||||
if osinfo is not None:
|
||||
|
||||
@@ -624,10 +624,8 @@ def test_translations(po_file, lang, domain, locale_dir):
|
||||
t = gettext.translation(domain, locale_dir)
|
||||
|
||||
if six.PY2:
|
||||
# pylint: disable=no-member
|
||||
get_msgstr = t.ugettext
|
||||
get_msgstr_plural = t.ungettext
|
||||
# pylint: enable=no-member
|
||||
else:
|
||||
get_msgstr = t.gettext
|
||||
get_msgstr_plural = t.ngettext
|
||||
|
||||
@@ -29,7 +29,7 @@ def pytest_generate_tests(metafunc):
|
||||
if callable(test):
|
||||
description = '%s: %s' % (
|
||||
str(i).zfill(4),
|
||||
test.__name__, # test is not a dict. pylint: disable=E1103
|
||||
test.__name__,
|
||||
)
|
||||
else:
|
||||
description = '%s: %s: %s' % (str(i).zfill(4),
|
||||
|
||||
@@ -1904,7 +1904,7 @@ def ldappasswd_user_change(user, oldpw, newpw, master, use_dirman=False,
|
||||
|
||||
if use_dirman:
|
||||
args = [paths.LDAPPASSWD, '-D',
|
||||
str(master.config.dirman_dn), # pylint: disable=no-member
|
||||
str(master.config.dirman_dn),
|
||||
'-w', master.config.dirman_password,
|
||||
'-s', newpw, '-x', '-ZZ', '-H', master_ldap_uri, userdn]
|
||||
else:
|
||||
@@ -1922,7 +1922,7 @@ def ldappasswd_sysaccount_change(user, oldpw, newpw, master, use_dirman=False):
|
||||
|
||||
if use_dirman:
|
||||
args = [paths.LDAPPASSWD, '-D',
|
||||
str(master.config.dirman_dn), # pylint: disable=no-member
|
||||
str(master.config.dirman_dn),
|
||||
'-w', master.config.dirman_password,
|
||||
'-a', oldpw,
|
||||
'-s', newpw, '-x', '-ZZ', '-H', master_ldap_uri,
|
||||
|
||||
@@ -10,8 +10,6 @@ from ipaserver.custodia.server.config import parse_config
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
EMPTY_CONF = os.path.join(HERE, 'empty.conf')
|
||||
|
||||
# pylint: disable=redefined-outer-name
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def args():
|
||||
|
||||
@@ -77,7 +77,7 @@ class IntegrationTest:
|
||||
else:
|
||||
domain_level = cls.master.config.domain_level
|
||||
|
||||
if cls.master.config.fips_mode: # pylint: disable=using-constant-test
|
||||
if cls.master.config.fips_mode:
|
||||
cls.fips_mode = True
|
||||
if cls.fips_mode:
|
||||
cls.enable_fips_mode()
|
||||
|
||||
@@ -102,15 +102,15 @@ class TestAutounmembership(IntegrationTest):
|
||||
def check_autounmembership_in_ldap(self, state='on'):
|
||||
"""Check autounmembership state."""
|
||||
conn = self.master.ldap_connect()
|
||||
entry = conn.get_entry(self.dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(self.dn)
|
||||
assert state == entry.single_value['automemberprocessmodifyops']
|
||||
|
||||
def disable_autounmembership_in_ldap(self):
|
||||
"""Disable autounmembership."""
|
||||
conn = self.master.ldap_connect()
|
||||
entry = conn.get_entry(self.dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(self.dn)
|
||||
entry.single_value['automemberprocessmodifyops'] = 'off'
|
||||
conn.update_entry(entry) # pylint: disable=no-member
|
||||
conn.update_entry(entry)
|
||||
self.master.run_command(['ipactl', 'restart'])
|
||||
|
||||
def test_modify_user_entry_unmembership(self):
|
||||
|
||||
@@ -131,11 +131,11 @@ class CALessBase(IntegrationTest):
|
||||
cls.cert_password = cls.master.config.admin_password
|
||||
cls.crl_path = os.path.join(cls.master.config.test_dir, 'crl')
|
||||
|
||||
if cls.replicas: # pylint: disable=using-constant-test
|
||||
if cls.replicas:
|
||||
replica_hostname = cls.replicas[0].hostname
|
||||
else:
|
||||
replica_hostname = 'unused-replica.test'
|
||||
if cls.clients: # pylint: disable=using-constant-test
|
||||
if cls.clients:
|
||||
client_hostname = cls.clients[0].hostname
|
||||
else:
|
||||
client_hostname = 'unused-client.test'
|
||||
|
||||
@@ -363,7 +363,7 @@ class TestIPACommand(IntegrationTest):
|
||||
master = self.master
|
||||
|
||||
# Add a system account and add it to a group managed by the policy
|
||||
base_dn = str(master.domain.basedn) # pylint: disable=no-member
|
||||
base_dn = str(master.domain.basedn)
|
||||
entry_ldif = textwrap.dedent("""
|
||||
dn: uid={account_name},cn=sysaccounts,cn=etc,{base_dn}
|
||||
changetype: add
|
||||
@@ -877,7 +877,7 @@ class TestIPACommand(IntegrationTest):
|
||||
)
|
||||
|
||||
conn = self.master.ldap_connect()
|
||||
entry = conn.get_entry(dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(dn)
|
||||
|
||||
# original setting and all settings without state
|
||||
orig_cfg = list(entry['ipaConfigString'])
|
||||
@@ -888,19 +888,19 @@ class TestIPACommand(IntegrationTest):
|
||||
cfg = [HIDDEN_SERVICE]
|
||||
cfg.extend(other_cfg)
|
||||
entry['ipaConfigString'] = cfg
|
||||
conn.update_entry(entry) # pylint: disable=no-member
|
||||
conn.update_entry(entry)
|
||||
self.master.run_command(['ipa', 'config-show'])
|
||||
|
||||
# test with configured
|
||||
cfg = [CONFIGURED_SERVICE]
|
||||
cfg.extend(other_cfg)
|
||||
entry['ipaConfigString'] = cfg
|
||||
conn.update_entry(entry) # pylint: disable=no-member
|
||||
conn.update_entry(entry)
|
||||
self.master.run_command(['ipa', 'config-show'])
|
||||
finally:
|
||||
# reset
|
||||
entry['ipaConfigString'] = orig_cfg
|
||||
conn.update_entry(entry) # pylint: disable=no-member
|
||||
conn.update_entry(entry)
|
||||
|
||||
def test_ssh_from_controller(self):
|
||||
"""https://pagure.io/SSSD/sssd/issue/3979
|
||||
@@ -1255,9 +1255,9 @@ class TestIPACommand(IntegrationTest):
|
||||
)
|
||||
assert console_msg in result.stdout_text
|
||||
# verify using backend
|
||||
conn = self.master.ldap_connect() # pylint: disable=no-member
|
||||
conn = self.master.ldap_connect()
|
||||
dn = DN(('cn', 'NIS Server'), ('cn', 'plugins'), ('cn', 'config'))
|
||||
entry = conn.get_entry(dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(dn)
|
||||
nispluginstring = entry.get('nsslapd-pluginEnabled')
|
||||
assert 'on' in nispluginstring
|
||||
# restart for changes to take effect
|
||||
@@ -1289,9 +1289,9 @@ class TestIPACommand(IntegrationTest):
|
||||
)
|
||||
assert msg in result.stdout_text
|
||||
# verify using backend
|
||||
conn = self.master.ldap_connect() # pylint: disable=no-member
|
||||
conn = self.master.ldap_connect()
|
||||
dn = DN(('cn', 'NIS Server'), ('cn', 'plugins'), ('cn', 'config'))
|
||||
entry = conn.get_entry(dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(dn)
|
||||
nispluginstring = entry.get('nsslapd-pluginEnabled')
|
||||
assert 'off' in nispluginstring
|
||||
# restart dirsrv for changes to take effect
|
||||
|
||||
@@ -757,7 +757,7 @@ class TestInstallMaster(IntegrationTest):
|
||||
related: https://pagure.io/freeipa/issue/8193
|
||||
"""
|
||||
conn = self.master.ldap_connect()
|
||||
entry = conn.get_entry(DN( # pylint: disable=no-member
|
||||
entry = conn.get_entry(DN(
|
||||
"cn=groups,cn=Schema Compatibility,cn=plugins,cn=config"))
|
||||
|
||||
entry_list = list(entry['schema-compat-entry-attribute'])
|
||||
|
||||
@@ -964,15 +964,15 @@ class TestIpaHealthCheck(IntegrationTest):
|
||||
dn = DN(
|
||||
("cn", "config"),
|
||||
)
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value["nsslapd-logging-hr-timestamps-enabled"] = 'off'
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
yield
|
||||
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value["nsslapd-logging-hr-timestamps-enabled"] = 'on'
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
def test_ipahealthcheck_ds_configcheck(self, update_logging):
|
||||
"""
|
||||
@@ -1104,15 +1104,15 @@ class TestIpaHealthCheck(IntegrationTest):
|
||||
("cn", "plugins"),
|
||||
("cn", "config"),
|
||||
)
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value["referint-update-delay"] = -1
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
yield
|
||||
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value["referint-update-delay"] = 0
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
def test_ipahealthcheck_ds_riplugincheck(self, update_riplugin):
|
||||
"""
|
||||
@@ -1140,15 +1140,15 @@ class TestIpaHealthCheck(IntegrationTest):
|
||||
"""
|
||||
ldap = self.master.ldap_connect()
|
||||
dn = DN(("cn", "config"),)
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value["nsslapd-rootpwstoragescheme"] = "MD5"
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
yield
|
||||
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value["nsslapd-rootpwstoragescheme"] = "PBKDF2_SHA256"
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
def test_ds_configcheck_passwordstorage(self, modify_pwdstoragescheme):
|
||||
"""
|
||||
@@ -1563,16 +1563,16 @@ class TestIpaHealthCheckWithADtrust(IntegrationTest):
|
||||
("cn", "etc"),
|
||||
basedn,
|
||||
)
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
krbprinc = entry['member']
|
||||
entry['member'] = ''
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
yield
|
||||
|
||||
# Add the entry back
|
||||
entry['member'] = krbprinc
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
def test_trustcontroller_principalcheck(self, modify_cifs_princ):
|
||||
"""
|
||||
@@ -2643,19 +2643,19 @@ class TestIpaHealthCheckWithExternalCA(IntegrationTest):
|
||||
"""
|
||||
ldap = self.master.ldap_connect()
|
||||
dn = DN(("uid", "ipara"), ("ou", "People"), ("o", "ipaca"))
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
ldap_cert_desc = entry.single_value.get("description")
|
||||
|
||||
def _update_entry(description):
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value['description'] = description
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
yield _update_entry
|
||||
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
entry.single_value['description'] = ldap_cert_desc
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
def test_ipahealthcheck_iparaagent_ldap(self, update_ra_cert_desc):
|
||||
"""
|
||||
|
||||
@@ -276,7 +276,7 @@ class TestOTPToken(IntegrationTest):
|
||||
This requires paramiko until the 2-prompt sshpass RFE is
|
||||
fulfilled: https://sourceforge.net/p/sshpass/feature-requests/5/
|
||||
"""
|
||||
if self.master.is_fips_mode: # pylint: disable=no-member
|
||||
if self.master.is_fips_mode:
|
||||
pytest.skip("paramiko is not compatible with FIPS mode")
|
||||
|
||||
master = self.master
|
||||
@@ -323,7 +323,7 @@ class TestOTPToken(IntegrationTest):
|
||||
new_limit = 30
|
||||
conn = self.master.ldap_connect()
|
||||
dn = DN(('cn', 'config'))
|
||||
entry = conn.get_entry(dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(dn)
|
||||
orig_limit = entry.single_value.get('nsslapd-idletimeout')
|
||||
ldap_query = textwrap.dedent("""
|
||||
dn: cn=config
|
||||
|
||||
@@ -211,13 +211,11 @@ class TestSMB(IntegrationTest):
|
||||
\s*SID:\s*S-1-5-21-\d+-\d+-\d+\n
|
||||
\s+ID\ range:\s*\d+\s*-\s*\d+
|
||||
'''
|
||||
# pylint: disable=no-member
|
||||
ipa_regexp = domain_regexp_tpl.format(
|
||||
domain=re.escape(self.master.domain.name),
|
||||
netbios=self.master.netbios)
|
||||
ad_regexp = domain_regexp_tpl.format(
|
||||
domain=re.escape(self.ad.domain.name), netbios=self.ad.netbios)
|
||||
# pylint: enable=no-member
|
||||
output_regexp = r'''
|
||||
Discovered\ domains.*
|
||||
{}
|
||||
|
||||
@@ -221,7 +221,7 @@ class TestSSSDWithAdTrust(IntegrationTest):
|
||||
master = self.master
|
||||
conn = master.ldap_connect()
|
||||
dn = DN(('cn', 'config'))
|
||||
entry = conn.get_entry(dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(dn)
|
||||
orig_limit = entry.single_value.get('nsslapd-sizelimit')
|
||||
ldap_query = textwrap.dedent("""
|
||||
dn: cn=config
|
||||
|
||||
@@ -636,12 +636,12 @@ class TestTrust(BaseTestTrust):
|
||||
client.run_command(test_id)
|
||||
|
||||
conn = self.master.ldap_connect()
|
||||
entry = conn.get_entry(extdom_dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(extdom_dn)
|
||||
orig_extdom_timeout = entry.single_value.get('ipaextdommaxnsstimeout')
|
||||
|
||||
# set the extdom plugin timeout to 1s (1000)
|
||||
entry.single_value['ipaextdommaxnsstimeout'] = 1000
|
||||
conn.update_entry(entry) # pylint: disable=no-member
|
||||
conn.update_entry(entry)
|
||||
self.master.run_command(['ipactl', 'restart'])
|
||||
|
||||
with tasks.remote_sssd_config(self.master) as sssd_conf:
|
||||
@@ -667,9 +667,9 @@ class TestTrust(BaseTestTrust):
|
||||
self.master.run_command('kill -CONT %s' % pid)
|
||||
# reconnect and set back to default extdom plugin
|
||||
conn = self.master.ldap_connect()
|
||||
entry = conn.get_entry(extdom_dn) # pylint: disable=no-member
|
||||
entry = conn.get_entry(extdom_dn)
|
||||
entry.single_value['ipaextdommaxnsstimeout'] = orig_extdom_timeout
|
||||
conn.update_entry(entry) # pylint: disable=no-member
|
||||
conn.update_entry(entry)
|
||||
tasks.restore_files(self.master)
|
||||
self.master.run_command(['ipactl', 'restart'])
|
||||
|
||||
|
||||
@@ -129,14 +129,14 @@ class TestUpgrade(IntegrationTest):
|
||||
ldap = self.master.ldap_connect()
|
||||
basedn = self.master.domain.basedn
|
||||
dn = DN(('cn', 'CAcert'), ('cn', 'ipa'), ('cn', 'etc'), basedn)
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
# Extract the certificate as DER then double-encode
|
||||
cacert = entry['cacertificate;binary'][0]
|
||||
cacert_der = cacert.public_bytes(serialization.Encoding.DER)
|
||||
cacert_b64 = base64.b64encode(cacert_der)
|
||||
# overwrite the value with double-encoded cert
|
||||
entry.single_value['cACertificate;binary'] = cacert_b64
|
||||
ldap.update_entry(entry) # pylint: disable=no-member
|
||||
ldap.update_entry(entry)
|
||||
|
||||
# try the upgrade
|
||||
self.master.run_command(['ipa-server-upgrade'])
|
||||
@@ -144,7 +144,7 @@ class TestUpgrade(IntegrationTest):
|
||||
# reconnect to the master (upgrade stops 389-ds)
|
||||
ldap = self.master.ldap_connect()
|
||||
# read the value after upgrade, should be fixed
|
||||
entry = ldap.get_entry(dn) # pylint: disable=no-member
|
||||
entry = ldap.get_entry(dn)
|
||||
try:
|
||||
_cacert = entry['cacertificate;binary']
|
||||
except ValueError:
|
||||
|
||||
@@ -463,7 +463,7 @@ class test_Command(ClassChecker):
|
||||
api.finalize()
|
||||
o = my_cmd(api)
|
||||
o.finalize()
|
||||
e = o.get_default(**kw) # pylint: disable=not-callable
|
||||
e = o.get_default(**kw)
|
||||
assert type(e) is dict
|
||||
assert 'option2' in e
|
||||
assert e['option2'] == u'some value'
|
||||
|
||||
@@ -605,7 +605,7 @@ class test_Param(ClassChecker):
|
||||
|
||||
def __init__(self, name, **kw):
|
||||
# (Pylint complains because the superclass is unknowm)
|
||||
# pylint: disable=bad-super-call, super-on-old-class
|
||||
# pylint: disable=super-on-old-class
|
||||
self._convert_scalar = PassThrough()
|
||||
super(Str, self).__init__(name, **kw)
|
||||
|
||||
|
||||
@@ -390,7 +390,5 @@ class test_rpcclient_context(PluginTester):
|
||||
r'^ipa_session=MagBearerToken=[A-Za-z0-9+\/]+=*;$')
|
||||
|
||||
session_cookie = getattr(context, 'session_cookie', None)
|
||||
# pylint-2 is incorrectly spewing Too many positional arguments
|
||||
# pylint: disable=E1121
|
||||
unquoted = urllib.parse.unquote(session_cookie)
|
||||
assert(unquoted == fuzzy_cookie)
|
||||
|
||||
@@ -531,7 +531,6 @@ class TestRDN:
|
||||
def test_assignments(self):
|
||||
rdn = RDN((self.attr1, self.value1))
|
||||
with pytest.raises(TypeError):
|
||||
# pylint: disable=unsupported-assignment-operation
|
||||
rdn[0] = self.ava2
|
||||
|
||||
def test_iter(self):
|
||||
@@ -997,10 +996,8 @@ class TestDN:
|
||||
def test_assignments(self):
|
||||
dn = DN('t=0,t=1,t=2,t=3,t=4,t=5,t=6,t=7,t=8,t=9')
|
||||
with pytest.raises(TypeError):
|
||||
# pylint: disable=unsupported-assignment-operation
|
||||
dn[0] = RDN('t=a')
|
||||
with pytest.raises(TypeError):
|
||||
# pylint: disable=unsupported-assignment-operation
|
||||
dn[0:1] = [RDN('t=a'), RDN('t=b')]
|
||||
|
||||
def test_iter(self):
|
||||
|
||||
@@ -44,8 +44,6 @@ class Unauthorized_HTTP_test:
|
||||
"""
|
||||
if params is not None:
|
||||
if self.content_type == 'application/x-www-form-urlencoded':
|
||||
# urlencode *can* take two arguments
|
||||
# pylint: disable=too-many-function-args
|
||||
params = urllib.parse.urlencode(params, True)
|
||||
url = 'https://' + self.host + self.app_uri
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ class InstallerTestBase(six.with_metaclass(ABCMeta, object)):
|
||||
"class first.")
|
||||
|
||||
# add all options from the option groups
|
||||
# pylint: disable=no-member
|
||||
for opt_group in cls.tested_cls.option_parser.option_groups:
|
||||
for opt in opt_group.option_list:
|
||||
cls.OPTS_DICT[opt.dest] = opt._short_opts + opt._long_opts
|
||||
|
||||
@@ -106,7 +106,7 @@ class AutomountTest(XMLRPC_test):
|
||||
skipped=(),
|
||||
duplicatemaps=(),
|
||||
duplicatekeys=(),
|
||||
)), res) # pylint: disable=used-before-assignment
|
||||
)), res)
|
||||
self.check_tofiles()
|
||||
finally:
|
||||
res = api.Command['automountlocation_del'](self.locname)['result']
|
||||
|
||||
@@ -53,7 +53,7 @@ def test_exc_wrapper():
|
||||
# Test with one callback first
|
||||
|
||||
@test_callback.register_exc_callback
|
||||
def handle_exception( # pylint: disable=unused-variable
|
||||
def handle_exception(
|
||||
self, keys, options, e, call_func, *args, **kwargs):
|
||||
assert args == (1, 2)
|
||||
assert kwargs == dict(a=1, b=2)
|
||||
@@ -151,7 +151,7 @@ def test_exc_callback_registration():
|
||||
pass
|
||||
|
||||
@callbacktest_subclass.register_exc_callback
|
||||
def exc_callback( # pylint: disable=unused-variable
|
||||
def exc_callback(
|
||||
self, keys, options, exc, call_func, *args, **kwargs):
|
||||
"""Subclass's private exception callback"""
|
||||
messages.append('Subclass registered callback')
|
||||
@@ -165,7 +165,7 @@ def test_exc_callback_registration():
|
||||
|
||||
|
||||
@callbacktest_base.register_exc_callback
|
||||
def exc_callback_2( # pylint: disable=unused-variable
|
||||
def exc_callback_2(
|
||||
self, keys, options, exc, call_func, *args, **kwargs):
|
||||
"""Callback on super class; doesn't affect the subclass"""
|
||||
messages.append('Superclass registered callback')
|
||||
|
||||
Reference in New Issue
Block a user