From: Dagfinn Ilmari Mannsåker Date: Mon, 22 Aug 2011 10:16:38 +0000 (+0100) Subject: Silence NOTICE-level messages from PostgreSQL X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=6a0c6847c3af2fb11d6f05932036b86f77979aa5;p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate Silence NOTICE-level messages from PostgreSQL They are uninteresting and make it harder to spot actual errors and warnings. --- 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);