Update output text as per review
This commit is contained in:
parent
cdd827be5c
commit
01a2f54954
|
@ -92,9 +92,7 @@ def warning_record_to_str(warning_message: warnings.WarningMessage) -> str:
|
|||
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.
|
||||
msg += (
|
||||
f"\nObject allocated at (most recent call first):\n{formatted_tb}"
|
||||
)
|
||||
msg += f"\nObject allocated at:\n{formatted_tb}"
|
||||
else:
|
||||
# No need for a leading new line.
|
||||
url = "https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings"
|
||||
|
|
|
@ -819,7 +819,7 @@ def test_resource_warning(pytester: Pytester, monkeypatch: pytest.MonkeyPatch) -
|
|||
expected_extra = (
|
||||
[
|
||||
"*ResourceWarning* unclosed file*",
|
||||
"*Object allocated at (most recent call first)*",
|
||||
"*Object allocated at*",
|
||||
]
|
||||
if has_tracemalloc
|
||||
else []
|
||||
|
|
Loading…
Reference in New Issue