From c6fbbd9181d0e94803f255205ac47fa1f852a493 Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Thu, 5 Mar 2020 13:20:14 +1300 Subject: [PATCH] Disable test_blocking_inside_a_runtime without cfg(debug_assertions) As by default, when executing tests with -C opt-level=n where "n" is greater than 0, debug assertions are disabled, which removes the panic!() this test is expecting. With this tweak, tests no longer fail with any choice of -C opt-level, and additionally, tests still execute correctly if these tests are compiled with: -C opt-level=3 -C debug-assertions=yes Closes: https://github.com/seanmonstar/reqwest/issues/831 --- tests/blocking.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/blocking.rs b/tests/blocking.rs index 4b6bfab..ccb5bdf 100644 --- a/tests/blocking.rs +++ b/tests/blocking.rs @@ -274,6 +274,7 @@ fn test_appended_headers_not_overwritten() { assert_eq!(res.status(), reqwest::StatusCode::OK); } +#[cfg_attr(not(debug_assertions), ignore)] #[test] #[should_panic] fn test_blocking_inside_a_runtime() {