Skip to content

Commit

Permalink
update test files
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Dec 3, 2023
1 parent ec5f178 commit 9a4c078
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions test/test_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 6 additions & 4 deletions test/test_mypy.py
Original file line number Diff line number Diff line change
@@ -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'
5 changes: 3 additions & 2 deletions test/test_pep257.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 9a4c078

Please sign in to comment.