test/pylint: check error code instead of exception

Instead of using `subprocess` with `check=True`, which will
echo the command used, including all the files it checked,
check the error code and if non-zero, fail the test with a
nice small error message.
This commit is contained in:
Christian Kellner 2022-08-04 19:00:41 +02:00
parent cae23de605
commit 5c8d11ebe1

View file

@ -52,7 +52,9 @@ def test_pylint(source_files):
# modules we have.
#
subprocess.run(["pylint"] + source_files, check=True)
r = subprocess.run(["pylint"] + source_files, check=False)
if r.returncode != 0:
pytest.fail("pylint issues detected")
@pytest.mark.skipif(not test.TestBase.have_autopep8(), reason="autopep8 not available")