Bug 14197: Remove the warning on destroying TestBuilder objects
authorJonathan Druart <jonathan.druart@koha-community.org>
Wed, 13 May 2015 15:58:45 +0000 (17:58 +0200)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Wed, 16 Sep 2015 13:40:35 +0000 (10:40 -0300)
This module will be called by db_dependent tests, which already create a
transaction.
TestBuilder creates a new one (which is certainly useless) and the
rollback does not do anything.

To see the warning see patches on bug 14045.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
t/lib/TestBuilder.pm

index 5d3157a..72b087d 100644 (file)
@@ -357,7 +357,9 @@ sub _gen_blob {
 
 sub DESTROY {
     my $self = shift;
-    $self->schema->txn_rollback();
+    eval {
+        $self->schema->txn_rollback();
+    };
 }