Skip to content

Commit 96f28b3

Browse files
committed
refactor: avoid duplicate testing code
1 parent 0b8d952 commit 96f28b3

File tree

6 files changed

+9
-141
lines changed

6 files changed

+9
-141
lines changed

datafusion-postgres/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pub mod auth;
22
pub(crate) mod client;
33
mod handlers;
44
pub mod hooks;
5-
#[cfg(test)]
5+
#[cfg(any(test, debug_assertions))]
66
pub mod testing;
77

88
use std::fs::File;

datafusion-postgres/tests/common/mod.rs

Lines changed: 0 additions & 128 deletions
This file was deleted.

datafusion-postgres/tests/dbeaver.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
mod common;
2-
3-
use common::*;
41
use pgwire::api::query::SimpleQueryHandler;
52

3+
use datafusion_postgres::testing::*;
4+
65
const DBEAVER_QUERIES: &[&str] = &[
76
"SET extra_float_digits = 3",
87
"SET application_name = 'PostgreSQL JDBC Driver'",

datafusion-postgres/tests/metabase.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
mod common;
2-
3-
use common::*;
41
use pgwire::api::query::SimpleQueryHandler;
52

3+
use datafusion_postgres::testing::*;
4+
65
const METABASE_QUERIES: &[&str] = &[
76
"SET extra_float_digits = 2",
87
"SET application_name = 'Metabase v0.55.1 [f8f63fdf-d8f8-4573-86ea-4fe4a9548041]'",

datafusion-postgres/tests/pgcli.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
mod common;
2-
3-
use common::*;
41
use pgwire::api::query::SimpleQueryHandler;
52

3+
use datafusion_postgres::testing::*;
4+
65
const PGCLI_QUERIES: &[&str] = &[
76
"SELECT 1",
87
"show time zone",

datafusion-postgres/tests/psql.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
mod common;
2-
3-
use common::*;
41
use pgwire::api::query::SimpleQueryHandler;
52

3+
use datafusion_postgres::testing::*;
4+
65
const PSQL_QUERIES: &[&str] = &[
76
"SELECT c.oid,
87
n.nspname,

0 commit comments

Comments
 (0)