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())
|
formatted_tb = "\n".join(tb.format())
|
||||||
# Use a leading new line to better separate the (large) output
|
# Use a leading new line to better separate the (large) output
|
||||||
# from the traceback to the previous warning text.
|
# from the traceback to the previous warning text.
|
||||||
msg += (
|
msg += f"\nObject allocated at:\n{formatted_tb}"
|
||||||
f"\nObject allocated at (most recent call first):\n{formatted_tb}"
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
# No need for a leading new line.
|
# No need for a leading new line.
|
||||||
url = "https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings"
|
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 = (
|
expected_extra = (
|
||||||
[
|
[
|
||||||
"*ResourceWarning* unclosed file*",
|
"*ResourceWarning* unclosed file*",
|
||||||
"*Object allocated at (most recent call first)*",
|
"*Object allocated at*",
|
||||||
]
|
]
|
||||||
if has_tracemalloc
|
if has_tracemalloc
|
||||||
else []
|
else []
|
||||||
|
|
Loading…
Reference in New Issue