From d471a80f7d8b2adb6225dad923bfdbc56eaf25fe Mon Sep 17 00:00:00 2001 From: Kingsword Date: Mon, 8 Sep 2025 16:40:56 +0800 Subject: [PATCH] fix(tests): Switch from --nocapture to --no-capture (#30638) `--no-capture` was added in 1.88, with `--nocapture` being soft-deprecated. https://releases.rs/docs/1.88.0/#libraries --- tests/specs/README.md | 4 ++-- tests/specs/mod.rs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/specs/README.md b/tests/specs/README.md index 436dc09409..2d2e69db02 100644 --- a/tests/specs/README.md +++ b/tests/specs/README.md @@ -26,11 +26,11 @@ Or just the following, though it might run other tests: cargo test test_name ``` -To run showing the output of every test use `-- --nocapture` (note: this will +To run showing the output of every test use `-- --no-capture` (note: this will cause tests to run sequentially instead of in parallel): ``` -cargo test test_name -- --nocapture +cargo test test_name -- --no-capture ``` ## `__test__.json` file diff --git a/tests/specs/mod.rs b/tests/specs/mod.rs index 16cd700c57..dfc5bbae5f 100644 --- a/tests/specs/mod.rs +++ b/tests/specs/mod.rs @@ -25,8 +25,9 @@ use test_util::tests_path; const MANIFEST_FILE_NAME: &str = "__test__.jsonc"; -static NO_CAPTURE: Lazy = - Lazy::new(|| std::env::args().any(|arg| arg == "--nocapture")); +static NO_CAPTURE: Lazy = Lazy::new(|| { + std::env::args().any(|arg| arg == "--no-capture" || arg == "--nocapture") +}); #[derive(Clone, Deserialize)] #[serde(untagged)]