X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest.pm;fp=t%2Flib%2FDBICTest.pm;h=49df0605c5d7bc4233b4362ef5e1177f7c42e34c;hb=2c2bc4e58c2146670960fc1a0a2ae802cb650506;hp=aa20b0c0d536d04ada3bccb8e2c4f6037be0260d;hpb=c8dc7d3337cdd47a721739473b61c8d4477d9129;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index aa20b0c..49df060 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -5,7 +5,7 @@ use strict; use warnings; use DBICTest::Util 'local_umask'; -use DBICTest::Schema; +use DBICTest::RunMode; use DBICTest::Util::LeakTracer qw/populate_weakregistry assert_empty_weakregistry/; use Carp; use Path::Class::File (); @@ -314,6 +314,8 @@ sub init_schema { my $schema; + require DBICTest::Schema; + if ($args{compose_connection}) { $schema = DBICTest::Schema->compose_connection( 'DBICTest', $self->_database(%args) @@ -343,7 +345,11 @@ sub init_schema { } END { + # Make sure we run after any cleanup in other END blocks + require B; + push @{ B::end_av()->object_2svref }, sub { assert_empty_weakregistry($weak_registry, 'quiet'); + }; } =head2 deploy_schema @@ -570,4 +576,10 @@ sub populate_schema { ]); } +sub connect_schema { + my $self = shift; + require DBICTest::Schema; + return DBICTest::Schema->connect(@_); +} + 1;