Skip to content

Commit 2ba8c2b

Browse files
committed
test: add tests to improve code coverage
1 parent 3cd427d commit 2ba8c2b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

postgresql_embedded/src/error.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ impl From<tokio::time::error::Elapsed> for EmbeddedError {
8080
#[cfg(test)]
8181
mod test {
8282
use super::*;
83-
use std::time::Duration;
84-
use tokio::time::timeout;
8583

8684
#[test]
8785
fn test_from_archive_error() {
@@ -114,8 +112,8 @@ mod test {
114112
#[cfg(feature = "tokio")]
115113
#[tokio::test]
116114
async fn test_from_elapsed_error() {
117-
let result = timeout(Duration::from_nanos(1), async {
118-
tokio::time::sleep(Duration::from_millis(1)).await;
115+
let result = tokio::time::timeout(std::time::Duration::from_nanos(1), async {
116+
tokio::time::sleep(std::time::Duration::from_millis(1)).await;
119117
})
120118
.await;
121119
assert!(result.is_err());

0 commit comments

Comments
 (0)