404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.118.166.157: ~ $
# 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

import functools
from collections.abc import Callable
from typing import Any

from pylint.testutils.checker_test_case import CheckerTestCase


def set_config(**kwargs: Any) -> Callable[[Callable[..., None]], Callable[..., None]]:
    """Decorator for setting an option on the linter.

    Passing the args and kwargs back to the test function itself
    allows this decorator to be used on parameterized test cases.
    """

    def _wrapper(fun: Callable[..., None]) -> Callable[..., None]:
        @functools.wraps(fun)
        def _forward(
            self: CheckerTestCase, *args: Any, **test_function_kwargs: Any
        ) -> None:
            """Set option via argparse."""
            for key, value in kwargs.items():
                self.linter.set_option(key, value)

            # Reopen checker in case, it may be interested in configuration change
            self.checker.open()

            fun(self, *args, **test_function_kwargs)

        return _forward

    return _wrapper

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
_primer Folder 0755
functional Folder 0755
__init__.py File 1.28 KB 0644
_run.py File 1.51 KB 0644
checker_test_case.py File 4.27 KB 0644
configuration_test.py File 5.89 KB 0644
constants.py File 1.12 KB 0644
decorator.py File 1.22 KB 0644
functional_test_file.py File 635 B 0644
get_test_info.py File 2.08 KB 0644
global_test_linter.py File 685 B 0644
lint_module_test.py File 12.5 KB 0644
output_line.py File 5.76 KB 0644
pyreverse.py File 4.1 KB 0644
reporter_for_tests.py File 2.25 KB 0644
testing_pylintrc File 198 B 0644
tokenize_str.py File 447 B 0644
unittest_linter.py File 2.73 KB 0644
utils.py File 3.06 KB 0644