From: Peter Rabbitson Date: Thu, 21 Aug 2008 15:22:58 +0000 (+0000) Subject: Properly local()ize several $SIG{__WARN__} handlers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fc38383ecabbb8d8fac82460dc3eb9e67a5ef0d4;p=dbsrgits%2FDBIx-Class-Historic.git Properly local()ize several $SIG{__WARN__} handlers --- diff --git a/t/100extra_source.t b/t/100extra_source.t index ac92209..5c531fd 100644 --- a/t/100extra_source.t +++ b/t/100extra_source.t @@ -26,7 +26,7 @@ my $new_source = DBICTest::ResultSource::OtherSource->new({ $new_source->add_column('other_col' => { data_type => 'integer', default_value => 1 }); my $warn = ''; -$SIG{__WARN__} = sub { $warn = shift }; +local $SIG{__WARN__} = sub { $warn = shift }; { $schema->register_extra_source( 'artist->extra' => $new_source ); diff --git a/t/94versioning.t b/t/94versioning.t index d9e2c41..633100e 100644 --- a/t/94versioning.t +++ b/t/94versioning.t @@ -95,7 +95,7 @@ eval "use DBICVersionNew"; my $warn = ''; - $SIG{__WARN__} = sub { $warn = shift }; + local $SIG{__WARN__} = sub { $warn = shift }; $schema_version = DBICVersion::Schema->connect($dsn, $user, $pass); like($warn, qr/Your DB is currently unversioned/, 'warning detected without env var or attr'); diff --git a/t/cdbi-t/15-accessor.t b/t/cdbi-t/15-accessor.t index ad28a63..30f61c8 100644 --- a/t/cdbi-t/15-accessor.t +++ b/t/cdbi-t/15-accessor.t @@ -213,5 +213,4 @@ eval { like $@, qr/read only/, "And can't delete 4 Days in July"; my $abigail = eval { Film->create({ title => "Abigail's Party" }) }; like $@, qr/read only/, "Or create new films"; - $SIG{__WARN__} = sub { }; }