]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/commitdiff
Silence NOTICE-level messages from PostgreSQL
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Mon, 22 Aug 2011 10:16:38 +0000 (11:16 +0100)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Mon, 22 Aug 2011 10:16:38 +0000 (11:16 +0100)
They are uninteresting and make it harder to spot actual errors and
warnings.

t/lib/DBSchemaBase.pm
t/pg.t

index 5b19a6e5d8dba63371ca9e7e7957a209a380fdc2..4b7e6a4952d8253d9909355717fe34cd9c7d97a4 100644 (file)
@@ -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 8afc89191d39fe45651bdc2e693e608233814943..d11e10dbe2337678f07840fa9dc1e7071c6df0ab 100644 (file)
--- 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);
This page took 0.025401 seconds and 4 git commands to generate.