From 6a0c6847c3af2fb11d6f05932036b86f77979aa5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Mon, 22 Aug 2011 11:16:38 +0100 Subject: [PATCH] Silence NOTICE-level messages from PostgreSQL They are uninteresting and make it harder to spot actual errors and warnings. --- t/lib/DBSchemaBase.pm | 4 ++-- t/pg.t | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/t/lib/DBSchemaBase.pm b/t/lib/DBSchemaBase.pm index 5b19a6e..4b7e6a4 100644 --- a/t/lib/DBSchemaBase.pm +++ b/t/lib/DBSchemaBase.pm @@ -11,10 +11,10 @@ sub tables_exist { } sub get_test_schema { - my ( $class, $dsn, $user, $pass ) = @_; + my ( $class, $dsn, $user, $pass, $opts ) = @_; $dsn ||= 'dbi:SQLite:dbname=t/var/dvdzbr.db'; warn "testing $dsn\n"; - my $schema = $class->connect( $dsn, $user, $pass, {} ); + my $schema = $class->connect( $dsn, $user, $pass, $opts || {} ); my $deploy_attrs; $deploy_attrs->{add_drop_table} = 1 if tables_exist( $schema->storage->dbh ); $schema->deploy( $deploy_attrs ); diff --git a/t/pg.t b/t/pg.t index 8afc891..d11e10d 100644 --- a/t/pg.t +++ b/t/pg.t @@ -12,6 +12,7 @@ plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test' . ' (note: creates and tables!)' unless ( $dsn && $user ); -my $schema = DBSchema->get_test_schema( $dsn, $user, $pass ); - +my $schema = DBSchema->get_test_schema( $dsn, $user, $pass, { + on_connect_do => [ 'SET client_min_messages=WARNING' ], +} ); run_tests($schema); -- 2.45.2