Skip to content

Commit eec4baf

Browse files
committed
relax the database test helpers module visibility
1 parent 5c26009 commit eec4baf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

database/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub mod metric;
1414
pub mod pool;
1515
pub mod selector;
1616

17-
#[cfg(test)]
1817
mod tests;
1918

2019
pub use pool::{Connection, Pool};

database/src/tests/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ enum TestDb {
1616
/// Represents a connection to a Postgres database that can be
1717
/// used in integration tests to test logic that interacts with
1818
/// a database.
19-
pub(crate) struct TestContext {
19+
pub struct TestContext {
2020
test_db: TestDb,
2121
// Pre-cached client to avoid creating unnecessary connections in tests
2222
client: Pool,
@@ -85,7 +85,7 @@ impl TestContext {
8585
}
8686
}
8787

88-
pub(crate) fn db_client(&self) -> &Pool {
88+
pub fn db_client(&self) -> &Pool {
8989
&self.client
9090
}
9191

@@ -114,7 +114,7 @@ impl TestContext {
114114
}
115115

116116
/// Runs a test against an actual postgres database.
117-
pub(crate) async fn run_postgres_test<F, Fut>(f: F)
117+
pub async fn run_postgres_test<F, Fut>(f: F)
118118
where
119119
F: Fn(TestContext) -> Fut,
120120
Fut: Future<Output = anyhow::Result<TestContext>>,
@@ -141,7 +141,7 @@ where
141141

142142
/// Runs a test against an actual database.
143143
/// Checks both Postgres and SQLite.
144-
pub(crate) async fn run_db_test<F, Fut>(f: F)
144+
pub async fn run_db_test<F, Fut>(f: F)
145145
where
146146
F: Fn(TestContext) -> Fut + Clone,
147147
Fut: Future<Output = anyhow::Result<TestContext>>,

0 commit comments

Comments
 (0)