forked from openlp/openlp
Fix some linting issues, and fix the test for newer versions of PyLint
This commit is contained in:
parent
f7e1dcbea1
commit
a408e3d74e
@ -101,6 +101,20 @@ class RegistryProperties(object):
|
||||
"""
|
||||
This adds registry components to classes to use at run time.
|
||||
"""
|
||||
_application = None
|
||||
_plugin_manager = None
|
||||
_image_manager = None
|
||||
_media_controller = None
|
||||
_service_manager = None
|
||||
_preview_controller = None
|
||||
_live_controller = None
|
||||
_main_window = None
|
||||
_renderer = None
|
||||
_theme_manager = None
|
||||
_settings_form = None
|
||||
_alerts_manager = None
|
||||
_projector_manager = None
|
||||
|
||||
@property
|
||||
def application(self):
|
||||
"""
|
||||
|
@ -58,17 +58,21 @@ class TestPylint(TestCase):
|
||||
# GIVEN: Some checks to disable and enable, and the pylint script
|
||||
disabled_checks = 'import-error,no-member'
|
||||
enabled_checks = 'missing-format-argument-key,unused-format-string-argument,bad-format-string'
|
||||
if is_win() or 'arch' in platform.dist()[0].lower():
|
||||
pylint_script = 'pylint'
|
||||
else:
|
||||
pylint_script = 'pylint3'
|
||||
pylint_kwargs = {
|
||||
'return_std': True
|
||||
}
|
||||
if version < '1.7.0':
|
||||
if is_win() or 'arch' in platform.dist()[0].lower():
|
||||
pylint_kwargs.update({'script': 'pylint'})
|
||||
else:
|
||||
pylint_kwargs.update({'script': 'pylint3'})
|
||||
|
||||
# WHEN: Running pylint
|
||||
(pylint_stdout, pylint_stderr) = \
|
||||
lint.py_run('openlp --errors-only --disable={disabled} --enable={enabled} '
|
||||
'--reports=no --output-format=parseable'.format(disabled=disabled_checks,
|
||||
enabled=enabled_checks),
|
||||
return_std=True, script=pylint_script)
|
||||
**pylint_kwargs)
|
||||
stdout = pylint_stdout.read()
|
||||
stderr = pylint_stderr.read()
|
||||
filtered_stdout = self._filter_tolerated_errors(stdout)
|
||||
|
Loading…
Reference in New Issue
Block a user