From ff3d9b26c7ef39c3eb49e54171e5b389d1df3f14 Mon Sep 17 00:00:00 2001 From: Cheuk Ting Ho Date: Tue, 17 May 2022 14:54:02 +0100 Subject: [PATCH] Update src/_pytest/python.py Co-authored-by: Bruno Oliveira --- src/_pytest/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 90e884d21..4d1f722e4 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -197,7 +197,7 @@ def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]: elif result is not None: warnings.warn( PytestReturnNotNoneWarning( - f"Expected None, but the test returned {result!r}, which will be an error in a " + f"Expected None, but {pyfuncitem.nodeid} returned {result!r}, which will be an error in a " "future version of pytest. Did you mean to use `assert` instead of `return`?" ) )