From 7bb3be84078db714adf30182ef0e59389ee3620d Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Sun, 11 Oct 2020 11:40:43 -0400 Subject: [PATCH] Update test_flake8.py files Signed-off-by: Christophe Bedard --- ros2trace_analysis/test/test_flake8.py | 8 +++++--- tracetools_analysis/test/test_flake8.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ros2trace_analysis/test/test_flake8.py b/ros2trace_analysis/test/test_flake8.py index eff8299..27ee107 100644 --- a/ros2trace_analysis/test/test_flake8.py +++ b/ros2trace_analysis/test/test_flake8.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ament_flake8.main import main +from ament_flake8.main import main_with_errors import pytest @pytest.mark.flake8 @pytest.mark.linter def test_flake8(): - rc = main(argv=[]) - assert rc == 0, 'Found errors' + rc, errors = main_with_errors(argv=[]) + assert rc == 0, \ + 'Found %d code style errors / warnings:\n' % len(errors) + \ + '\n'.join(errors) diff --git a/tracetools_analysis/test/test_flake8.py b/tracetools_analysis/test/test_flake8.py index eff8299..27ee107 100644 --- a/tracetools_analysis/test/test_flake8.py +++ b/tracetools_analysis/test/test_flake8.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ament_flake8.main import main +from ament_flake8.main import main_with_errors import pytest @pytest.mark.flake8 @pytest.mark.linter def test_flake8(): - rc = main(argv=[]) - assert rc == 0, 'Found errors' + rc, errors = main_with_errors(argv=[]) + assert rc == 0, \ + 'Found %d code style errors / warnings:\n' % len(errors) + \ + '\n'.join(errors)