404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.22.75.92: ~ $
# 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 glob import glob
from os.path import basename, join, splitext

from pylint.testutils.constants import SYS_VERS_STR


def _get_tests_info(
    input_dir: str, msg_dir: str, prefix: str, suffix: str
) -> list[tuple[str, str]]:
    """Get python input examples and output messages.

    We use following conventions for input files and messages:
    for different inputs:
        test for python  >= x.y    ->  input   =  <name>_pyxy.py
        test for python  <  x.y    ->  input   =  <name>_py_xy.py
    for one input and different messages:
        message for python >=  x.y ->  message =  <name>_pyxy.txt
        lower versions             ->  message with highest num
    """
    result = []
    for fname in glob(join(input_dir, prefix + "*" + suffix)):
        infile = basename(fname)
        fbase = splitext(infile)[0]
        # filter input files :
        pyrestr = fbase.rsplit("_py", 1)[-1]  # like _26 or 26
        if pyrestr.isdigit():  # '24', '25'...
            if pyrestr.isdigit() and int(SYS_VERS_STR) < int(pyrestr):
                continue
        if pyrestr.startswith("_") and pyrestr[1:].isdigit():
            # skip test for higher python versions
            if pyrestr[1:].isdigit() and int(SYS_VERS_STR) >= int(pyrestr[1:]):
                continue
        messages = glob(join(msg_dir, fbase + "*.txt"))
        # the last one will be without ext, i.e. for all or upper versions:
        if messages:
            for outfile in sorted(messages, reverse=True):
                py_rest = outfile.rsplit("_py", 1)[-1][:-4]
                if py_rest.isdigit() and int(SYS_VERS_STR) >= int(py_rest):
                    break
        else:
            # This will provide an error message indicating the missing filename.
            outfile = join(msg_dir, fbase + ".txt")
        result.append((infile, outfile))
    return result

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