X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/pylint/testutils
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pylint
/
testutils
/
ðŸ“
..
📄
__init__.py
(1.28 KB)
ðŸ“
__pycache__
ðŸ“
_primer
📄
_run.py
(1.51 KB)
📄
checker_test_case.py
(4.27 KB)
📄
configuration_test.py
(5.89 KB)
📄
constants.py
(1.12 KB)
📄
decorator.py
(1.22 KB)
ðŸ“
functional
📄
functional_test_file.py
(635 B)
📄
get_test_info.py
(2.08 KB)
📄
global_test_linter.py
(685 B)
📄
lint_module_test.py
(12.5 KB)
📄
output_line.py
(5.76 KB)
📄
pyreverse.py
(4.1 KB)
📄
reporter_for_tests.py
(2.25 KB)
📄
testing_pylintrc
(198 B)
📄
tokenize_str.py
(447 B)
📄
unittest_linter.py
(2.73 KB)
📄
utils.py
(3.06 KB)
Editing: 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
Upload File
Create Folder