SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > site-packages > pylint > testutils


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/testutils

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
_primer Directory - -
functional Directory - -
__init__.py File 1309 bytes April 17 2025 13:10:59.
_run.py File 1549 bytes April 17 2025 13:10:59.
checker_test_case.py File 4377 bytes April 17 2025 13:10:59.
configuration_test.py File 6036 bytes April 17 2025 13:10:59.
constants.py File 1145 bytes April 17 2025 13:10:59.
decorator.py File 1252 bytes April 17 2025 13:10:59.
functional_test_file.py File 635 bytes April 17 2025 13:10:59.
get_test_info.py File 2127 bytes April 17 2025 13:10:59.
global_test_linter.py File 685 bytes April 17 2025 13:10:59.
lint_module_test.py File 12801 bytes April 17 2025 13:10:59.
output_line.py File 5897 bytes April 17 2025 13:10:59.
pyreverse.py File 4194 bytes April 17 2025 13:10:59.
reporter_for_tests.py File 2306 bytes April 17 2025 13:10:59.
testing_pylintrc File 198 bytes April 17 2025 13:10:59.
tokenize_str.py File 447 bytes April 17 2025 13:10:59.
unittest_linter.py File 2795 bytes April 17 2025 13:10:59.
utils.py File 3133 bytes April 17 2025 13:10:59.

Reading File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/testutils/reporter_for_tests.py

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt

from __future__ import annotations

from io import StringIO
from os import getcwd, sep
from typing import TYPE_CHECKING

from pylint.message import Message
from pylint.reporters import BaseReporter

if TYPE_CHECKING:
    from pylint.reporters.ureports.nodes import Section


class GenericTestReporter(BaseReporter):
    """Reporter storing plain text messages."""

    out: StringIO

    def __init__(  # pylint: disable=super-init-not-called # See https://github.com/PyCQA/pylint/issues/4941
        self,
    ) -> None:
        self.path_strip_prefix: str = getcwd() + sep
        self.reset()

    def reset(self) -> None:
        self.out = StringIO()
        self.messages: list[Message] = []

    def handle_message(self, msg: Message) -> None:
        """Append messages to the list of messages of the reporter."""
        self.messages.append(msg)

    def finalize(self) -> str:
        """Format and print messages in the context of the path."""
        messages: list[str] = []
        for msg in self.messages:
            obj = ""
            if msg.obj:
                obj = f":{msg.obj}"
            messages.append(f"{msg.msg_id[0]}:{msg.line:>3}{obj}: {msg.msg}")

        messages.sort()
        for message in messages:
            print(message, file=self.out)

        result = self.out.getvalue()
        self.reset()
        return result

    def on_set_current_module(self, module: str, filepath: str | None) -> None:
        pass

    # pylint: enable=unused-argument

    def display_reports(self, layout: Section) -> None:
        """Ignore layouts."""

    def _display(self, layout: Section) -> None:
        pass


class MinimalTestReporter(BaseReporter):
    def on_set_current_module(self, module: str, filepath: str | None) -> None:
        self.messages = []

    def _display(self, layout: Section) -> None:
        pass


class FunctionalTestReporter(BaseReporter):
    def display_reports(self, layout: Section) -> None:
        """Ignore layouts and don't call self._display()."""

    def _display(self, layout: Section) -> None:
        pass

SILENT KILLER Tool