diff --git a/test/test_flake8.py b/test/test_flake8.py index eac16ee..d9f9ab3 100644 --- a/test/test_flake8.py +++ b/test/test_flake8.py @@ -19,7 +19,8 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + """Tests flake8 on this module.""" + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/test/test_mypy.py b/test/test_mypy.py index 9b896ad..2cb49a3 100644 --- a/test/test_mypy.py +++ b/test/test_mypy.py @@ -1,12 +1,14 @@ -from ament_mypy.main import main import os + import pytest +from ament_mypy.main import main @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" file_path = __file__.replace(f'{__name__}.py', '') - config_file = os.path.join(file_path, '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/test/test_pep257.py b/test/test_pep257.py index b6808e1..8e7dfaa 100644 --- a/test/test_pep257.py +++ b/test/test_pep257.py @@ -19,5 +19,6 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings'