Only load DBICTest::Schema when needed in tests
[dbsrgits/DBIx-Class.git] / t / 750firebird.t
index aef3fcf..c1e625a 100644 (file)
@@ -47,7 +47,7 @@ for my $prefix (keys %$env2optdep) { SKIP: {
   skip ("Testing with ${prefix}_DSN needs " . DBIx::Class::Optional::Dependencies->req_missing_for( $env2optdep->{$prefix} ), 1)
     unless  DBIx::Class::Optional::Dependencies->req_ok_for($env2optdep->{$prefix});
 
-  $schema = DBICTest::Schema->connect($dsn, $user, $pass, {
+  $schema = DBICTest->connect_schema($dsn, $user, $pass, {
     auto_savepoint  => 1,
     quote_names     => 1,
     ($dsn !~ /ODBC/ ? (on_connect_call => 'use_softcommit') : ()),
@@ -255,6 +255,14 @@ EOF
     } 'inferring generator from trigger source works';
   }
 
+  # at this point there should be no active statements
+  # (finish() was called everywhere, either explicitly via
+  # reset() or on DESTROY)
+  for (keys %{$schema->storage->dbh->{CachedKids}}) {
+    fail("Unreachable cached statement still active: $_")
+      if $schema->storage->dbh->{CachedKids}{$_}->FETCH('Active');
+  }
+
 # test blobs (stolen from 73oracle.t)
   eval { $dbh->do('DROP TABLE "bindtype_test"') };
   $dbh->do(q[