From 8f1a8800c86815885c041acfb2048652882bd2e8 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 25 Dec 2021 10:49:40 +0200 Subject: [PATCH] Merge pull request #9416 from bluetech/doc-stash-fix doc: fix a reference in "Writing hook functions" (cherry picked from commit 443aa0219c0b5170a2f858c1ccea013cf88c6a6c) --- doc/en/how-to/writing_hook_functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index 663bceb63..f615fced8 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -321,7 +321,7 @@ Plugins often need to store data on :class:`~pytest.Item`\s in one hook implementation, and access it in another. One common solution is to just assign some private attribute directly on the item, but type-checkers like mypy frown upon this, and it may also cause conflicts with other plugins. -So pytest offers a better way to do this, :attr:`_pytest.nodes.Node.stash `. +So pytest offers a better way to do this, :attr:`item.stash <_pytest.nodes.Node.stash>`. To use the "stash" in your plugins, first create "stash keys" somewhere at the top level of your plugin: