JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 88.223.91.96  /  Your IP : 216.73.217.129
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/pytest_check/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/pytest_check/plugin.py
import sys
import os
from typing import Generator, TYPE_CHECKING

import pytest
from pytest import CallInfo, Config, Item, Parser, TestReport
from _pytest.skipping import xfailed_key
from _pytest._code.code import (
    ExceptionChainRepr,
    ExceptionInfo,
    ExceptionRepr,
    ReprFileLocation,
)
if TYPE_CHECKING:  # pragma: no cover
    from pluggy import Result

from . import check_log, check_raises, context_manager, pseudo_traceback
from .context_manager import CheckContextManager


@pytest.hookimpl(hookwrapper=True, trylast=True)
def pytest_runtest_makereport(
    item: Item, call: CallInfo[None]
) -> "Generator[None, Result[TestReport], None]":
    outcome: "Result[TestReport]" = yield
    report: TestReport = outcome.get_result()

    num_failures = check_log._num_failures
    failures = check_log.get_failures()
    check_log.clear_failures()

    if failures:
        xfailed_value = item._store.get(xfailed_key, None)
        if xfailed_value and not item.config.option.runxfail:
            report.outcome = "skipped"
            report.wasxfail = xfailed_value.reason
        else:
            summary = f"Failed Checks: {num_failures}"
            longrepr = ["\n".join(failures)]
            longrepr.append("-" * 60)
            longrepr.append(summary)

            if report.longrepr:
                longrepr.append("-" * 60)
                longrepr.append(report.longreprtext)
                report.longrepr = "\n".join(longrepr)
            else:
                report.longrepr = "\n".join(longrepr)
            report.outcome = "failed"
            try:
                raise AssertionError(report.longrepr)
            except AssertionError as e:
                excinfo = ExceptionInfo.from_current()
                if (pytest.version_tuple >= (7,3,0)
                        and not os.getenv('PYTEST_XDIST_WORKER')):
                    # Build a summary report with failure reason
                    # Depends on internals of pytest, which changed in 7.3
                    # Also, doesn't work with xdist
                    #
                    # Example: Before 7.3:
                    #   =========== short test summary info ===========
                    #   FAILED test_example_simple.py::test_fail
                    # Example after 7.3:
                    #   =========== short test summary info ===========
                    #   FAILED test_example_simple.py::test_fail - assert 1 == 2
                    #
                    e_str = str(e)
                    e_str = e_str.split('FAILURE: ')[1]  # Remove redundant "Failure: "
                    reprcrash = ReprFileLocation(item.nodeid, 0, e_str)
                    # FIXME - the next two lines have broken types
                    reprtraceback = ExceptionRepr(reprcrash, excinfo)  # type: ignore
                    chain_repr = ExceptionChainRepr([(reprtraceback, reprcrash, str(e))])  # type: ignore
                    report.longrepr = chain_repr
                else:  # pragma: no cover
                    # coverage is run on latest pytest
                    # we'll have one test run on an older pytest just to make sure
                    # it works.
                    ...

            call.excinfo = excinfo


def pytest_configure(config: Config) -> None:
    # Add some red to the failure output, if stdout can accommodate it.
    isatty = sys.stdout.isatty()
    color = getattr(config.option, "color", None)
    check_log.should_use_color = (isatty and color == "auto") or (color == "yes")

    # If -x or --maxfail=1, then stop on the first failed check
    # Otherwise, let pytest stop on the maxfail-th test function failure
    maxfail = config.getvalue("maxfail")
    stop_on_fail = maxfail == 1

    # TODO: perhaps centralize where we're storing stop_on_fail
    context_manager._stop_on_fail = stop_on_fail
    check_raises._stop_on_fail = stop_on_fail
    check_log._stop_on_fail = stop_on_fail

    # Allow for --tb=no to turn off check's pseudo tbs
    traceback_style = config.getoption("tbstyle", default=None)
    pseudo_traceback._traceback_style = traceback_style
    check_log._showlocals = config.getoption("showlocals", default=None)

    # grab options
    check_log._default_max_fail = config.getoption("--check-max-fail")
    check_log._default_max_report = config.getoption("--check-max-report")
    check_log._default_max_tb = config.getoption("--check-max-tb")


# Allow for tests to grab "check" via fixture:
# def test_a(check):
#    check.equal(a, b)
@pytest.fixture(name="check")
def check_fixture() -> CheckContextManager:
    return context_manager.check


# add some options
def pytest_addoption(parser: Parser) -> None:
    parser.addoption(
        "--check-max-report",
        action="store",
        type=int,
        help="max failures to report",
    )
    parser.addoption(
        "--check-max-fail",
        action="store",
        type=int,
        help="max failures per test",
    )
    parser.addoption(
        "--check-max-tb",
        action="store",
        type=int,
        default=1,
        help="max pseudo-tracebacks per test",
    )

Youez - 2016 - github.com/yon3zu
LinuXploit