Add dotenv support for tests

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/9/head
trivernis 2 years ago
parent fa904761f5
commit a74cabcbcc
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

1
.gitignore vendored

@ -1,2 +1,3 @@
/target
Cargo.lock
.env

@ -22,6 +22,7 @@ lazy_static = "1.4.0"
[dev-dependencies]
env_logger = "0.8.4"
maplit = "1.0.2"
dotenv = "0.15.0"
[dev-dependencies.tokio]
version = "1.8.0"

@ -8,6 +8,7 @@ use std::sync::Arc;
pub fn setup() {
lazy_static::lazy_static! { static ref SETUP_DONE: Arc<AtomicBool> = Arc::new(AtomicBool::new(false)); }
if !SETUP_DONE.swap(true, Ordering::SeqCst) {
dotenv::dotenv().expect("failed to initialize dotenv");
env_logger::builder()
.filter_level(LevelFilter::Trace)
.init();

Loading…
Cancel
Save