Skip to content

Commit f65f0c1

Browse files
committed
more verbose test_flake8 error messages (same as ros2/launch_ros#135)
Signed-off-by: Dirk Thomas <[email protected]>
1 parent 948b4f4 commit f65f0c1

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

demo_nodes_py/test/test_flake8.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from ament_flake8.main import main
15+
from ament_flake8.main import main_with_errors
1616
import pytest
1717

1818

1919
@pytest.mark.flake8
2020
@pytest.mark.linter
2121
def test_flake8():
22-
rc = main(argv=[])
23-
assert rc == 0, 'Found errors'
22+
rc, errors = main_with_errors(argv=[])
23+
assert rc == 0, \
24+
'Found %d code style errors / warnings:\n' % len(errors) + \
25+
'\n'.join(errors)

topic_monitor/test/test_flake8.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from ament_flake8.main import main
15+
from ament_flake8.main import main_with_errors
1616
import pytest
1717

1818

1919
@pytest.mark.flake8
2020
@pytest.mark.linter
2121
def test_flake8():
22-
rc = main(argv=[])
23-
assert rc == 0, 'Found errors'
22+
rc, errors = main_with_errors(argv=[])
23+
assert rc == 0, \
24+
'Found %d code style errors / warnings:\n' % len(errors) + \
25+
'\n'.join(errors)

0 commit comments

Comments
 (0)