mirror of
https://github.com/actix/examples
synced 2025-04-22 08:34:52 +02:00
fix(tests): ignore tests if postgres isn't up
This commit is contained in:
parent
c8da70bb0a
commit
9a25c3b233
@ -3,6 +3,9 @@ name = "db-diesel-async"
|
||||
version = "1.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
postgres_tests = []
|
||||
|
||||
[dependencies]
|
||||
actix-web.workspace = true
|
||||
diesel = { version = "2", default-features = false, features = ["uuid"] }
|
||||
|
@ -106,7 +106,8 @@ async fn initialize_db_pool() -> DbPool {
|
||||
Pool::builder().build(connection_manager).await.unwrap()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(not(feature = "postgres_tests"))]
|
||||
#[allow(unused_imports)]
|
||||
mod tests {
|
||||
use actix_web::{http::StatusCode, test};
|
||||
use diesel::prelude::*;
|
||||
|
Loading…
x
Reference in New Issue
Block a user