GRAYBYTE WORDPRESS FILE MANAGER1677

Server IP : 198.54.121.189 / Your IP : 216.73.216.224
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/astroid/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/astroid//test_utils.py
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt

"""Utility functions for test code that uses astroid ASTs as input."""

from __future__ import annotations

import contextlib
import functools
import sys
import warnings
from collections.abc import Callable

import pytest

from astroid import manager, nodes, transforms


def require_version(minver: str = "0.0.0", maxver: str = "4.0.0") -> Callable:
    """Compare version of python interpreter to the given one and skips the test if older."""

    def parse(python_version: str) -> tuple[int, ...]:
        try:
            return tuple(int(v) for v in python_version.split("."))
        except ValueError as e:
            msg = f"{python_version} is not a correct version : should be X.Y[.Z]."
            raise ValueError(msg) from e

    min_version = parse(minver)
    max_version = parse(maxver)

    def check_require_version(f):
        current: tuple[int, int, int] = sys.version_info[:3]
        if min_version < current <= max_version:
            return f

        version: str = ".".join(str(v) for v in sys.version_info)

        @functools.wraps(f)
        def new_f(*args, **kwargs):
            if current <= min_version:
                pytest.skip(f"Needs Python > {minver}. Current version is {version}.")
            elif current > max_version:
                pytest.skip(f"Needs Python <= {maxver}. Current version is {version}.")

        return new_f

    return check_require_version


def get_name_node(start_from, name, index=0):
    return [n for n in start_from.nodes_of_class(nodes.Name) if n.name == name][index]


@contextlib.contextmanager
def enable_warning(warning):
    warnings.simplefilter("always", warning)
    try:
        yield
    finally:
        # Reset it to default value, so it will take
        # into account the values from the -W flag.
        warnings.simplefilter("default", warning)


def brainless_manager():
    m = manager.AstroidManager()
    # avoid caching into the AstroidManager borg since we get problems
    # with other tests :
    m.__dict__ = {}
    m._failed_import_hooks = []
    m.astroid_cache = {}
    m._mod_file_cache = {}
    m._transform = transforms.TransformVisitor()
    m.extension_package_whitelist = set()
    return m

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 25 2025 08:31:36
root / root
0755
__pycache__
--
May 15 2025 08:30:33
root / root
0755
brain
--
May 15 2025 08:30:33
root / root
0755
interpreter
--
May 15 2025 08:30:33
root / root
0755
nodes
--
May 15 2025 08:30:33
root / root
0755
__init__.py
4.984 KB
April 17 2025 13:10:59
root / root
0644
__pkginfo__.py
0.268 KB
April 17 2025 13:10:59
root / root
0644
_ast.py
4.049 KB
April 17 2025 13:10:59
root / root
0644
_backport_stdlib_names.py
6.852 KB
April 17 2025 13:10:59
root / root
0644
_cache.py
0.768 KB
April 17 2025 13:10:59
root / root
0644
arguments.py
12.654 KB
April 17 2025 13:10:59
root / root
0644
astroid_manager.py
0.559 KB
April 17 2025 13:10:59
root / root
0644
bases.py
24.994 KB
April 17 2025 13:10:59
root / root
0644
builder.py
18.348 KB
April 17 2025 13:10:59
root / root
0644
const.py
1.069 KB
April 17 2025 13:10:59
root / root
0644
constraint.py
4.925 KB
April 17 2025 13:10:59
root / root
0644
context.py
5.854 KB
April 17 2025 13:10:59
root / root
0644
decorators.py
9.854 KB
April 17 2025 13:10:59
root / root
0644
exceptions.py
12.782 KB
April 17 2025 13:10:59
root / root
0644
filter_statements.py
9.417 KB
April 17 2025 13:10:59
root / root
0644
helpers.py
11.07 KB
April 17 2025 13:10:59
root / root
0644
inference.py
44.063 KB
April 17 2025 13:10:59
root / root
0644
inference_tip.py
2.82 KB
April 17 2025 13:10:59
root / root
0644
manager.py
17.539 KB
April 17 2025 13:10:59
root / root
0644
mixins.py
1.154 KB
April 17 2025 13:10:59
root / root
0644
modutils.py
22.957 KB
April 17 2025 13:10:59
root / root
0644
node_classes.py
1.797 KB
April 17 2025 13:10:59
root / root
0644
objects.py
12.458 KB
April 17 2025 13:10:59
root / root
0644
protocols.py
32.203 KB
April 17 2025 13:10:59
root / root
0644
raw_building.py
22.339 KB
April 17 2025 13:10:59
root / root
0644
rebuilder.py
77.862 KB
April 17 2025 13:10:59
root / root
0644
scoped_nodes.py
0.936 KB
April 17 2025 13:10:59
root / root
0644
test_utils.py
2.377 KB
April 17 2025 13:10:59
root / root
0644
transforms.py
3.194 KB
April 17 2025 13:10:59
root / root
0644
typing.py
1.937 KB
April 17 2025 13:10:59
root / root
0644
util.py
4.618 KB
April 17 2025 13:10:59
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF