diff --git a/src/client.rs b/src/client.rs index cc7fb06..8a8a24f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -348,13 +348,13 @@ pub async fn json(path: String, quarantine: bool) -> Result { } } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_localization_popular() { let val = json("/r/popular/hot.json?&raw_json=1&geo_filter=GLOBAL".to_string(), false).await.unwrap(); assert_eq!("GLOBAL", val["data"]["geo_filter"].as_str().unwrap()); } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_obfuscated_share_link() { let share_link = "/r/rust/s/kPgq8WNHRK".into(); // Correct link without share parameters @@ -362,7 +362,7 @@ async fn test_obfuscated_share_link() { assert_eq!(canonical_path(share_link).await, Ok(Some(canonical_link))); } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_share_link_strip_json() { let link = "/17krzvz".into(); let canonical_link = "/r/nfl/comments/17krzvz/rapoport_sources_former_no_2_overall_pick/".into(); diff --git a/src/oauth.rs b/src/oauth.rs index 71dc1c9..9bc448d 100644 --- a/src/oauth.rs +++ b/src/oauth.rs @@ -172,21 +172,21 @@ fn choose(list: &[T]) -> T { *fastrand::choose_multiple(list.iter(), 1)[0] } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_oauth_client() { assert!(!OAUTH_CLIENT.read().await.token.is_empty()); } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_oauth_client_refresh() { OAUTH_CLIENT.write().await.refresh().await.unwrap(); } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_oauth_token_exists() { assert!(!OAUTH_CLIENT.read().await.token.is_empty()); } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_oauth_headers_len() { assert!(OAUTH_CLIENT.read().await.headers_map.len() >= 3); } diff --git a/src/subreddit.rs b/src/subreddit.rs index 4b71ad5..4f366b9 100644 --- a/src/subreddit.rs +++ b/src/subreddit.rs @@ -449,7 +449,7 @@ async fn subreddit(sub: &str, quarantined: bool) -> Result { }) } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_fetching_subreddit() { let subreddit = subreddit("rust", false).await; assert!(subreddit.is_ok()); diff --git a/src/user.rs b/src/user.rs index 8ffc366..0edcfd7 100644 --- a/src/user.rs +++ b/src/user.rs @@ -130,7 +130,7 @@ async fn user(name: &str) -> Result { }) } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_fetching_user() { let user = user("spez").await; assert!(user.is_ok()); diff --git a/src/utils.rs b/src/utils.rs index 3b1817c..4f08787 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1109,14 +1109,14 @@ mod tests { } } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_fetching_subreddit_quarantined() { let subreddit = Post::fetch("/r/drugs", true).await; assert!(subreddit.is_ok()); assert!(!subreddit.unwrap().0.is_empty()); } -#[tokio::test(flavor = "multi_thread", worker_threads = 1)] +#[tokio::test(flavor = "multi_thread")] async fn test_fetching_nsfw_subreddit() { let subreddit = Post::fetch("/r/randnsfw", false).await; assert!(subreddit.is_ok());