Description: skip network-requiring tests by default
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2025-02-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/error.rs
+++ b/src/error.rs
@@ -327,6 +327,7 @@
     use super::*;
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn status_code_error_redirect() {
         use crate::test::init_test_log;
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -36,7 +36,7 @@
 //!
 //! In its simplest form, ureq looks like this:
 //!
-//! ```rust
+//! ```rust,no_run
 //! let body: String = ureq::get("http://example.com")
 //!     .header("Example-Header", "header value")
 //!     .call()?
@@ -51,7 +51,7 @@
 //! [`Arc`] and all clones of an Agent share state among each other. Creating
 //! an Agent also allows setting options like the TLS configuration.
 //!
-//! ```rust
+//! ```rust,no_run
 //! # fn no_run() -> Result<(), ureq::Error> {
 //! use ureq::Agent;
 //! use std::time::Duration;
@@ -80,7 +80,7 @@
 //!
 //! Ureq supports sending and receiving json, if you enable the **json** feature:
 //!
-//! ```rust
+//! ```rust,no_run
 //! # #[cfg(feature = "json")]
 //! # fn no_run() -> Result<(), ureq::Error> {
 //! use serde::{Serialize, Deserialize};
@@ -114,7 +114,7 @@
 //!
 //! This behavior can be turned off via [`http_status_as_error()`]
 //!
-//! ```rust
+//! ```rust,no_run
 //! use ureq::Error;
 //!
 //! # fn no_run() -> Result<(), ureq::Error> {
@@ -177,7 +177,7 @@
 //! ureq does not guarantee to default to ring indefinitely. `rustls` as a feature flag will always
 //! work, but the specific crypto backend might change in a minor version.
 //!
-//! ```
+//! ```no_run
 //! # #[cfg(feature = "rustls")]
 //! # {
 //! // This uses rustls
@@ -203,7 +203,7 @@
 //! up as a default or used by the crate level convenience calls (`ureq::get` etc) – it
 //! must be configured on the agent.
 //!
-//! ```
+//! ```no_run
 //! # #[cfg(feature = "native-tls")]
 //! # {
 //! use ureq::config::Config;
@@ -247,7 +247,7 @@
 //! To use this verifier, you need to enable it using feature flag **platform-verifier** as well as
 //! configure an agent to use it.
 //!
-//! ```
+//! ```no_run
 //! # #[cfg(all(feature = "rustls", feature="platform-verifier"))]
 //! # {
 //! use ureq::Agent;
@@ -345,7 +345,7 @@
 //! sending the body, ureq will respect that header by not overriding it,
 //! and by encoding the body or not, as indicated by the headers you set.
 //!
-//! ```
+//! ```no_run
 //! let resp = ureq::put("https://httpbin.org/put")
 //!     .header("Transfer-Encoding", "chunked")
 //!     .send("Hello world")?;
@@ -388,7 +388,7 @@
 //!
 //! ## Example using HTTP
 //!
-//! ```rust
+//! ```rust,no_run
 //! use ureq::{Agent, Proxy};
 //! # fn no_run() -> std::result::Result<(), ureq::Error> {
 //! // Configure an http connect proxy.
@@ -406,7 +406,7 @@
 //!
 //! ## Example using SOCKS5
 //!
-//! ```rust
+//! ```rust,no_run
 //! use ureq::{Agent, Proxy};
 //! # #[cfg(feature = "socks-proxy")]
 //! # fn no_run() -> std::result::Result<(), ureq::Error> {
@@ -710,6 +710,7 @@
     }
 
     #[test]
+    #[ignore]
     fn connect_http_google() {
         init_test_log();
         let agent = Agent::new_with_defaults();
@@ -728,6 +729,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "rustls")]
     fn connect_https_google_rustls() {
         init_test_log();
@@ -754,6 +756,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "native-tls")]
     fn connect_https_google_native_tls_simple() {
         init_test_log();
@@ -828,6 +831,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "rustls")]
     fn connect_https_google_noverif() {
         init_test_log();
@@ -857,6 +861,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_put_content_len() {
         init_test_log();
         let mut res = put("http://httpbin.org/put").send(&[0_u8; 100]).unwrap();
@@ -864,6 +869,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_put_chunked() {
         init_test_log();
         let mut res = put("http://httpbin.org/put")
@@ -875,6 +881,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_get() {
         init_test_log();
         let mut res = get("http://httpbin.org/get").call().unwrap();
@@ -882,6 +889,7 @@
     }
 
     #[test]
+    #[ignore]
     fn simple_head() {
         init_test_log();
         let mut res = head("http://httpbin.org/get").call().unwrap();
@@ -889,6 +897,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_no_follow() {
         init_test_log();
         let agent: Agent = Config::builder().max_redirects(0).build().into();
@@ -904,6 +913,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_max_with_error() {
         init_test_log();
         let agent: Agent = Config::builder().max_redirects(3).build().into();
@@ -918,6 +928,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_max_without_error() {
         init_test_log();
         let agent: Agent = Config::builder()
@@ -936,6 +947,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_follow() {
         init_test_log();
         let res = get("http://httpbin.org/redirect-to?url=%2Fget")
@@ -946,6 +958,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_history_none() {
         init_test_log();
         let res = get("http://httpbin.org/redirect-to?url=%2Fget")
@@ -956,6 +969,7 @@
     }
 
     #[test]
+    #[ignore]
     fn redirect_history_some() {
         init_test_log();
         let agent: Agent = Config::builder()
@@ -1005,6 +1019,7 @@
     }
 
     #[test]
+    #[ignore]
     fn connect_https_invalid_name() {
         let result = get("https://example.com{REQUEST_URI}/").call();
         let err = result.unwrap_err();
@@ -1013,6 +1028,7 @@
     }
 
     #[test]
+    #[ignore]
     fn post_big_body_chunked() {
         // https://github.com/algesten/ureq/issues/879
         let mut data = io::Cursor::new(vec![42; 153_600]);
@@ -1023,6 +1039,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(not(feature = "_test"))]
     fn username_password_from_uri() {
         init_test_log();
@@ -1032,6 +1049,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(all(feature = "cookies", feature = "_test"))]
     fn store_response_cookies() {
         let agent = Agent::new_with_defaults();
@@ -1049,6 +1067,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(all(feature = "cookies", feature = "_test"))]
     fn send_request_cookies() {
         init_test_log();
@@ -1071,6 +1090,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(all(feature = "_test", not(feature = "cookies")))]
     fn partial_redirect_when_following() {
         init_test_log();
@@ -1079,6 +1099,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn partial_redirect_when_not_following() {
         init_test_log();
@@ -1093,6 +1114,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn http_connect_proxy() {
         init_test_log();
@@ -1133,6 +1155,7 @@
     }
 
     #[test]
+    #[ignore]
     fn limit_max_response_header_size() {
         init_test_log();
         let err = get("http://httpbin.org/get")
@@ -1145,6 +1168,7 @@
     }
 
     #[test]
+    #[ignore]
     fn propfind_with_body() {
         init_test_log();
 
@@ -1164,6 +1188,7 @@
     }
 
     #[test]
+    #[ignore]
     #[cfg(feature = "_test")]
     fn non_standard_method() {
         init_test_log();
--- a/src/agent.rs
+++ b/src/agent.rs
@@ -163,7 +163,7 @@
     /// all clones of the same [`Agent`], meaning you must drop the CookieJar
     /// before using the agent, or end up with a deadlock.
     ///
-    /// ```rust
+    /// ```rust,no_run
     /// # #[cfg(feature = "json")]
     /// # fn no_run() -> Result<(), ureq::Error> {
     /// use std::io::Write;
@@ -197,7 +197,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::{http, Agent};
     ///
     /// let agent: Agent = Agent::new_with_defaults();
--- a/src/request.rs
+++ b/src/request.rs
@@ -59,7 +59,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::http::Method;
     ///
     /// let req = ureq::get("http://httpbin.org/get");
@@ -79,7 +79,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("https://httpbin.org/get")
     ///     .header("X-Custom-Foo", "bar");
     /// ```
@@ -100,7 +100,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get")
     ///     .header("Accept", "text/html")
     ///     .header("X-Custom-Foo", "bar");
@@ -118,7 +118,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// # use ureq::http::header::HeaderValue;
     /// let mut req =  ureq::get("http://httpbin.org/get");
     /// {
@@ -142,7 +142,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// // Creates a URL with an encoded query parameter:
     /// // https://httpbin.org/get?my_query=with%20value
     /// let req = ureq::get("https://httpbin.org/get")
@@ -193,7 +193,7 @@
     ///
     /// For example, to set `?format=json&dest=%2Flogin`
     ///
-    /// ```
+    /// ```no_run
     /// let query = vec![
     ///     ("format", "json"),
     ///     ("dest", "/login"),
@@ -228,7 +228,7 @@
     ///
     /// For example, to set `?format=json&dest=/login` without encoding:
     ///
-    /// ```
+    /// ```no_run
     /// let query = vec![
     ///     ("format", "json"),
     ///     ("dest", "/login"),
@@ -258,7 +258,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("https://www.google.com/")
     ///     .uri("https://httpbin.org/get");
     /// ```
@@ -277,7 +277,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get");
     /// assert_eq!(req.uri_ref().unwrap(), "http://httpbin.org/get");
     /// ```
@@ -292,7 +292,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::http::Version;
     ///
     /// let req = ureq::get("https://www.google.com/")
@@ -309,7 +309,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::http::Version;
     ///
     /// let req = ureq::get("http://httpbin.org/get");
@@ -325,7 +325,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::Agent;
     ///
     /// let agent: Agent = Agent::config_builder()
@@ -354,7 +354,7 @@
     ///
     /// # Examples
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get")
     ///     .extension("My Extension");
     ///
@@ -375,7 +375,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let req = ureq::get("http://httpbin.org/get")
     ///     .extension("My Extension").extension(5u32);
     /// let extensions = req.extensions_ref().unwrap();
@@ -392,7 +392,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let mut req = ureq::get("http://httpbin.org/get");
     /// let mut extensions = req.extensions_mut().unwrap();
     /// extensions.insert(5u32);
@@ -442,7 +442,7 @@
     ///
     /// It sends neither `Content-Length` nor `Transfer-Encoding`.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("http://httpbin.org/get")
     ///     .call()?;
     /// # Ok::<_, ureq::Error>(())
@@ -462,7 +462,7 @@
     ///
     /// Example using DELETE while sending a body.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::delete("http://httpbin.org/delete")
     ///     // this "unlocks" send() below
     ///     .force_send_body()
@@ -504,7 +504,7 @@
 
     /// Set the content-type header.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::post("http://httpbin.org/post")
     ///     .content_type("text/html; charset=utf-8")
     ///     .send("<html><body>åäö</body></html>")?;
@@ -521,7 +521,7 @@
 
     /// Send body data and blocks the caller until we receive response.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::post("http://httpbin.org/post")
     ///     .send(&[0_u8; 1000])?;
     /// # Ok::<_, ureq::Error>(())
@@ -540,7 +540,7 @@
     ///
     /// This is equivalent to `.send(&[])`.
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::post("http://httpbin.org/post")
     ///     .send_empty()?;
     /// # Ok::<_, ureq::Error>(())
@@ -554,7 +554,7 @@
     /// Constructs a [form submission] with the content-type header
     /// `application/x-www-form-urlencoded`. Keys and values will be URL encoded.
     ///
-    /// ```
+    /// ```no_run
     /// let form = [
     ///     ("name", "martin"),
     ///     ("favorite_bird", "blue-footed booby"),
@@ -606,7 +606,7 @@
     /// to a string before sending (does allocate). Will set the content-type header
     /// `application/json`.
     ///
-    /// ```
+    /// ```no_run
     /// use serde::Serialize;
     ///
     /// #[derive(Serialize)]
--- a/src/response.rs
+++ b/src/response.rs
@@ -18,7 +18,7 @@
     ///
     /// This can differ from the request uri when we have followed redirects.
     ///
-    /// ```
+    /// ```no_run
     /// use ureq::ResponseExt;
     ///
     /// let res = ureq::get("https://httpbin.org/redirect-to?url=%2Fget")
@@ -34,7 +34,7 @@
     /// is `false`.
     ///
     ///
-    /// ```
+    /// ```no_run
     /// # use ureq::http::Uri;
     /// use ureq::ResponseExt;
     ///
--- a/src/body/mod.rs
+++ b/src/body/mod.rs
@@ -57,7 +57,7 @@
 ///
 /// # Example
 ///
-/// ```
+/// ```no_run
 /// use std::io::Read;
 /// let mut res = ureq::get("http://httpbin.org/bytes/100")
 ///     .call()?;
@@ -122,7 +122,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("https://www.google.com/")
     ///     .call()?;
     ///
@@ -146,7 +146,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("https://www.google.com/")
     ///     .call()?;
     ///
@@ -169,7 +169,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let res = ureq::get("https://httpbin.org/bytes/100")
     ///     .call()?;
     ///
@@ -195,7 +195,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// use std::io::Read;
     ///
     /// let mut res = ureq::get("http://httpbin.org/bytes/100")
@@ -219,7 +219,7 @@
     ///
     /// * Reader is not limited. To set a limit use [`Body::into_with_config()`].
     ///
-    /// ```
+    /// ```no_run
     /// use std::io::Read;
     ///
     /// let res = ureq::get("http://httpbin.org/bytes/100")
@@ -243,7 +243,7 @@
     ///
     /// To change these defaults use [`Body::with_config()`].
     ///
-    /// ```
+    /// ```no_run
     /// let mut res = ureq::get("http://httpbin.org/robots.txt")
     ///     .call()?;
     ///
@@ -263,7 +263,7 @@
     /// * Response is limited to 10MB.
     ///
     /// To change this default use [`Body::with_config()`].
-    /// ```
+    /// ```no_run
     /// let mut res = ureq::get("http://httpbin.org/bytes/100")
     ///     .call()?;
     ///
@@ -322,7 +322,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// let reader = ureq::get("http://httpbin.org/bytes/100")
     ///     .call()?
     ///     .body_mut()
@@ -343,7 +343,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// // Get the body out of http::Response
     /// let (_, body) = ureq::get("http://httpbin.org/bytes/100")
     ///     .call()?
@@ -424,7 +424,7 @@
     ///
     /// # Example of owned vs shared
     ///
-    /// ```
+    /// ```no_run
     /// // Creates an owned reader.
     /// let reader = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -436,7 +436,7 @@
     /// # Ok::<_, ureq::Error>(())
     /// ```
     ///
-    /// ```
+    /// ```no_run
     /// // Creates a shared reader.
     /// let reader = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -458,7 +458,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// // Reads max 10k to a String.
     /// let string = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -484,7 +484,7 @@
     ///
     /// # Example
     ///
-    /// ```
+    /// ```no_run
     /// // Reads max 10k to a Vec.
     /// let myvec = ureq::get("https://httpbin.org/get")
     ///     .call()?
@@ -613,7 +613,7 @@
 ///
 /// # Example
 ///
-/// ```
+/// ```no_run
 /// use std::io::Read;
 /// let mut res = ureq::get("http://httpbin.org/bytes/100")
 ///     .call()?;
--- a/src/send_body.rs
+++ b/src/send_body.rs
@@ -151,7 +151,7 @@
 ///
 /// These two examples are equivalent.
 ///
-/// ```
+/// ```no_run
 /// let data: &[u8] = b"My special request body data";
 ///
 /// let response = ureq::post("https://httpbin.org/post")
@@ -161,7 +161,7 @@
 ///
 /// Using `http` crate API
 ///
-/// ```
+/// ```no_run
 /// use ureq::http;
 ///
 /// let data: &[u8] = b"My special request body data";
--- a/src/unversioned/transport/mod.rs
+++ b/src/unversioned/transport/mod.rs
@@ -94,7 +94,7 @@
 ///
 /// # Example
 ///
-/// ```
+/// ```no_run
 /// # #[cfg(all(feature = "rustls", not(feature = "_test")))] {
 /// use ureq::{Agent, config::Config};
 ///
--- a/src/middleware.rs
+++ b/src/middleware.rs
@@ -116,7 +116,7 @@
 /// This example shows how we can increase a counter for each request going
 /// through the agent.
 ///
-/// ```
+/// ```no_run
 /// use ureq::{Body, SendBody, Agent, config::Config};
 /// use ureq::middleware::{Middleware, MiddlewareNext};
 /// use ureq::http::{Request, Response};
