Skip to content

Commit 686a234

Browse files
committed
If we fail to get a database handle for testing, BAIL_OUT right away
1 parent 8cba85d commit 686a234

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/CP_Testing.pm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ sub cleanup {
6666
}
6767

6868
sub test_database_handle {
69+
my $self = shift;
70+
my $dbh;
71+
eval { $dbh = $self->_test_database_handle(@ARGV) };
72+
if (!defined $dbh) {
73+
Test::More::diag $@;
74+
Test::More::BAIL_OUT 'Cannot continue without a test database';
75+
return undef;
76+
}
77+
return $dbh;
78+
}
79+
80+
sub _test_database_handle {
6981

7082
## Request for a database handle: create and startup DB as needed
7183

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy