From d7d444487180cee6e4613c98a0491ec8693daf76 Mon Sep 17 00:00:00 2001 From: Anis Da Silva Campos Date: Sat, 23 Dec 2023 21:43:11 +0100 Subject: [PATCH] Add test that runs pylint This shall uncover some hidden error, like non thread safe checks during multiprocess execution --- tests/test_pylint_integration.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/test_pylint_integration.py diff --git a/tests/test_pylint_integration.py b/tests/test_pylint_integration.py new file mode 100644 index 0000000..b8b2a67 --- /dev/null +++ b/tests/test_pylint_integration.py @@ -0,0 +1,29 @@ +""" +The tests in this file shall detect any error related to actual execution of pylint, while the +other test are more unit tests that focuses on the checkers behaviour. + +Notes: + Tests here are voluntarily minimalistic, the goal is not to test pylint, it is only checking + that pylint_pytest integrates just fine +""" +import subprocess + + +def test_simple_process(): + result = subprocess.run( + ["pylint", "--load-plugins", "pylint_pytest", "tests"], + capture_output=True, + check=False, + ) + # then no error + assert not result.stderr + + +def test_multi_process(): + result = subprocess.run( + ["pylint", "--load-plugins", "pylint_pytest", "-j", "2", "tests"], + capture_output=True, + check=False, + ) + # then no error + assert not result.stderr