From 1272cd988f73310e5d231847534620480357a48e Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Wed, 26 Jun 2024 16:02:37 +0200 Subject: [PATCH] examples: be more precise about TestReport outcome * testing only for "failed" should not be reported as "or skipped" * test for "skipped" explicitly instead Signed-off-by: Yann Dirson --- changelog/12535.doc.rst | 4 ++++ doc/en/example/simple.rst | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/12535.doc.rst diff --git a/changelog/12535.doc.rst b/changelog/12535.doc.rst new file mode 100644 index 00000000000..d43c1c822ea --- /dev/null +++ b/changelog/12535.doc.rst @@ -0,0 +1,4 @@ +`This +example` +showed ``print`` statements that do not exactly reflect what the +different branches actually do. The fix makes the example more precise. diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index a14c34c19c3..b50fbfed397 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -904,7 +904,9 @@ here is a little example implemented via a local plugin: # "function" scope report = request.node.stash[phase_report_key] if report["setup"].failed: - print("setting up a test failed or skipped", request.node.nodeid) + print("setting up a test failed", request.node.nodeid) + elif report["setup"].skipped: + print("setting up a test skipped", request.node.nodeid) elif ("call" not in report) or report["call"].failed: print("executing test failed or skipped", request.node.nodeid)