Groups | Search | Server Info | Login | Register


Groups > perl.dbd.pg.changes > #21

[DBD::Pg] Silence some spurious warnings in the tests

Newsgroups perl.dbd.pg.changes
Subject [DBD::Pg] Silence some spurious warnings in the tests
Date 2016-07-27 17:29 +0000
Message-ID <1469640549-14006-1-git-send-email-dbdpg-commits@bucardo.org> (permalink)
From dbdpg-commits@bucardo.org

Show all headers | View raw


Committed by =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>

Silence some spurious warnings in the tests

---
 t/02attribs.t | 1 +
 t/04misc.t    | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/02attribs.t b/t/02attribs.t
index 9547d27..57b044a 100644
--- a/t/02attribs.t
+++ b/t/02attribs.t
@@ -1619,6 +1619,7 @@ SKIP: {
 
 	for my $destroy (0,1) {
 
+		local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DESTROY failed: no connection/ }; # shut up destroy warning
 		$dbh = connect_database({nosetup => 1, AutoCommit => 1});
 		$sth = $dbh->prepare($SQL);
 		$sth->execute(1);
diff --git a/t/04misc.t b/t/04misc.t
index 4fcff8e..e032486 100644
--- a/t/04misc.t
+++ b/t/04misc.t
@@ -113,6 +113,8 @@ $BC$
 
 	is( $sth->err, undef, q{Statement attribute 'err' is initially undef});
 
+	$dbh->do(q{SET client_min_messages = 'FATAL'});
+
   TODO: {
 		local $TODO = q{Known bug: notice and warnings should set err to 6};
 
@@ -122,8 +124,6 @@ $BC$
 		}
 	}
 
-	$dbh->do(q{SET client_min_messages = 'FATAL'});
-
 	for my $level (qw/exception/) {
 		eval { $sth->execute($level);};
 		is( $sth->err, 7, qq{Statement attribute 'err' set to 7 for level $level});
-- 
1.8.4

Back to perl.dbd.pg.changes | Previous | Next | Find similar


Thread

[DBD::Pg] Silence some spurious warnings in the tests dbdpg-commits@bucardo.org - 2016-07-27 17:29 +0000

csiph-web