Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: PyLint unit test skipped if not installed except on TravisCI #1635

Merged
merged 9 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Back In Time

Version 1.4.4-dev (development of upcoming release)
* Build: PyLint unit test is skipped if PyLint isn't installed except TravisCI will raise an error (#1634)
buhtz marked this conversation as resolved.
Show resolved Hide resolved
* Build: Fix bash-completion symlink creation while installing & adding --diagnostics (#1615)
* Build: Activate PyLint error E602 (undefined-variable)
* Build: TravisCI use PyQt (except arch "ppc64le")
Expand Down
8 changes: 8 additions & 0 deletions common/test/test_lint.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import unittest
import os
import pathlib
import subprocess
import shutil
from typing import Iterable

ON_TRAVIS = os.environ.get('TRAVIS', '') == 'true'
PYLINT_AVIALBE = not shutil.which('pylint') is None
PYLINT_REASON = ('Using PyLint is mandatory on TravisCI and otherwise '
'optional to systems where PyLint is available.')
buhtz marked this conversation as resolved.
Show resolved Hide resolved


class MirrorMirrorOnTheWall(unittest.TestCase):
"""Check all py-files in the package (incl. test files) for lints and
Expand Down Expand Up @@ -32,6 +39,7 @@ def _collect_py_files(self) -> Iterable[pathlib.Path]:
# Find recursive all py-files.
return path.rglob('**/*.py')

@unittest.skipUnless(ON_TRAVIS or PYLINT_AVIALBE, PYLINT_REASON)
def test_with_pylint(self):
"""Use Pylint to check for specific error codes.

Expand Down
8 changes: 8 additions & 0 deletions qt/test/test_lint.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import unittest
import os
import pathlib
import subprocess
import shutil
from typing import Iterable

ON_TRAVIS = os.environ.get('TRAVIS', '') == 'true'
PYLINT_AVIALBE = not shutil.which('pylint') is None
PYLINT_REASON = ('Using PyLint is mandatory on TravisCI and otherwise '
'optional to systems where PyLint is available.')
buhtz marked this conversation as resolved.
Show resolved Hide resolved


class MirrorMirrorOnTheWall(unittest.TestCase):
"""Check all py-files in the package (incl. test files) for lints and
Expand Down Expand Up @@ -32,6 +39,7 @@ def _collect_py_files(self) -> Iterable[pathlib.Path]:
# Find recursive all py-files.
return path.rglob('**/*.py')

@unittest.skipUnless(ON_TRAVIS or PYLINT_AVIALBE, PYLINT_REASON)
def test_with_pylint(self):
"""Use Pylint to check for specific error codes.

Expand Down