From 5c8d11ebe1492b0290ff3ae512b6d854315586e6 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Thu, 4 Aug 2022 19:00:41 +0200 Subject: [PATCH] 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. --- test/src/test_pylint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/src/test_pylint.py b/test/src/test_pylint.py index 8542b037..c2f37130 100644 --- a/test/src/test_pylint.py +++ b/test/src/test_pylint.py @@ -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")