diff --git a/tests/__pycache__/test_lint.cpython-310-pytest-8.3.4.pyc b/tests/__pycache__/test_lint.cpython-310-pytest-8.3.4.pyc index 4f8c659..c0de964 100644 Binary files a/tests/__pycache__/test_lint.cpython-310-pytest-8.3.4.pyc and b/tests/__pycache__/test_lint.cpython-310-pytest-8.3.4.pyc differ diff --git a/tests/test_lint.py b/tests/test_lint.py index 5c5cfab..d636eab 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -1,9 +1,26 @@ import os -import pytest +import sys +from io import StringIO from pylint.lint import Run +import pytest def test_pylint(): """Run pylint on the project.""" - results = Run(['models'], do_exit=False) - score = results.linter.stats.global_note - assert score >= 7.0, f"Code quality score {score} is below threshold" + # Redirect stdout to capture pylint's output + old_stdout = sys.stdout + sys.stdout = StringIO() + + try: + # Run pylint with exit=False + results = Run(['models'], exit=False) + score = results.linter.stats.global_note + + # Restore stdout + sys.stdout = old_stdout + + # Check the code quality score + assert score >= 7.0, f"Code quality score {score} is below threshold" + except: + # Restore stdout before raising any exception + sys.stdout = old_stdout + raise