GRAYBYTE WORDPRESS FILE MANAGER2490

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.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
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/testutils/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/testutils//get_test_info.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 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

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 15 2025 08:30:34
root / root
0755
__pycache__
--
May 15 2025 08:30:34
root / root
0755
_primer
--
May 15 2025 08:30:34
root / root
0755
functional
--
May 15 2025 08:30:34
root / root
0755
__init__.py
1.278 KB
April 17 2025 13:10:59
root / root
0644
_run.py
1.513 KB
April 17 2025 13:10:59
root / root
0644
checker_test_case.py
4.274 KB
April 17 2025 13:10:59
root / root
0644
configuration_test.py
5.895 KB
April 17 2025 13:10:59
root / root
0644
constants.py
1.118 KB
April 17 2025 13:10:59
root / root
0644
decorator.py
1.223 KB
April 17 2025 13:10:59
root / root
0644
functional_test_file.py
0.62 KB
April 17 2025 13:10:59
root / root
0644
get_test_info.py
2.077 KB
April 17 2025 13:10:59
root / root
0644
global_test_linter.py
0.669 KB
April 17 2025 13:10:59
root / root
0644
lint_module_test.py
12.501 KB
April 17 2025 13:10:59
root / root
0644
output_line.py
5.759 KB
April 17 2025 13:10:59
root / root
0644
pyreverse.py
4.096 KB
April 17 2025 13:10:59
root / root
0644
reporter_for_tests.py
2.252 KB
April 17 2025 13:10:59
root / root
0644
testing_pylintrc
0.193 KB
April 17 2025 13:10:59
root / root
0644
tokenize_str.py
0.437 KB
April 17 2025 13:10:59
root / root
0644
unittest_linter.py
2.729 KB
April 17 2025 13:10:59
root / root
0644
utils.py
3.06 KB
April 17 2025 13:10:59
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF