chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

View File

@@ -0,0 +1,60 @@
#![cfg(feature = "unmanaged")]
use std::time::Duration;
use deadpool::{
unmanaged::{self, PoolConfig, PoolError},
Runtime,
};
type Pool = unmanaged::Pool<()>;
#[tokio::test]
async fn no_runtime() {
let pool = Pool::default();
assert!(matches!(
pool.timeout_get(Some(Duration::from_millis(1))).await,
Err(PoolError::NoRuntimeSpecified)
));
assert!(matches!(
pool.timeout_get(Some(Duration::from_millis(0))).await,
Err(PoolError::Timeout)
));
}
async fn _test_get(runtime: Runtime) {
let cfg = PoolConfig {
max_size: 16,
timeout: None,
runtime: Some(runtime),
};
let pool = Pool::from_config(&cfg);
assert!(matches!(
pool.timeout_get(Some(Duration::from_millis(1))).await,
Err(PoolError::Timeout),
));
}
async fn _test_config(runtime: Runtime) {
let cfg = PoolConfig {
max_size: 16,
timeout: Some(Duration::from_millis(1)),
runtime: Some(runtime),
};
let pool = Pool::from_config(&cfg);
assert!(matches!(pool.get().await, Err(PoolError::Timeout)));
}
#[cfg(feature = "rt_tokio_1")]
#[tokio::test]
async fn rt_tokio_1() {
_test_get(Runtime::Tokio1).await;
_test_config(Runtime::Tokio1).await;
}
#[cfg(feature = "rt_async-std_1")]
#[async_std::test]
async fn rt_async_std_1() {
_test_get(Runtime::AsyncStd1).await;
_test_config(Runtime::AsyncStd1).await;
}