pylint: Synchronize pylint plugin to ipatests code

Pylint is a static analysis tool and therefore, couldn't always
analyze dynamic stuff properly. Transformation plugins is a way
to teach Pylint how to handle such cases.

Particularly, with the help of FreeIPA own plugin, it is possible
to tell Pylint about instance fields having a duck-typing nature.

A drawback exposed here is that a static view (Pylint's) of code
should be consistent with an actual one, otherwise, codebase will
be polluted with various skips of pylint checks.

* added missing fields to ipatests.test_integration.base.IntegrationTest
* an attempt is made to clear `no-member` skips for ipatests
* removed no longer needed `pytest` module transformation

Related: https://pagure.io/freeipa/issue/8116
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Stanislav Levin
2019-12-28 12:26:22 +03:00
committed by Alexander Bokovoy
parent 92b440a0ba
commit e128e7d691
17 changed files with 31 additions and 52 deletions

View File

@@ -54,23 +54,19 @@ def pytest_configure(config):
capture = config.pluginmanager.getplugin('capturemanager')
orig_stdout, orig_stderr = sys.stdout, sys.stderr
if capture:
# pylint: disable=no-member
if hasattr(capture, 'suspend_global_capture'):
# pytest >= 3.3
capture.suspend_global_capture()
else:
# legacy support for pytest <= 3.2 (Fedora 27)
capture._capturing.suspend_capturing()
# pylint: enable=no-member
sys.stderr.write(self.format(record))
sys.stderr.write('\n')
if capture:
# pylint: disable=no-member
if hasattr(capture, 'resume_global_capture'):
capture.resume_global_capture()
else:
capture._capturing.resume_capturing()
# pylint: enable=no-member
sys.stdout, sys.stderr = orig_stdout, orig_stderr
level = convert_log_level(config.getoption('logging_level'))