[Jifty-commit] r7616 - jifty/trunk/lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Mon Nov 16 18:30:27 EST 2009


Author: sartak
Date: Mon Nov 16 18:30:26 2009
New Revision: 7616

Modified:
   jifty/trunk/lib/Jifty/Test.pm

Log:
Only run Jifty::Test's teardown code if it setup

Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Mon Nov 16 18:30:26 2009
@@ -121,10 +121,14 @@
 
 =cut
 
+our $imported = 0;
+
 sub import_extra {
     my $class = shift;
     my $args  = shift;
 
+    $imported = 1;
+
     $class->setup($args);
     Test::More->export_to_level(2);
 
@@ -640,6 +644,9 @@
 END { Jifty::Test->_ending }
 
 sub _ending {
+    # only run the teardown code if we were responsible for setup
+    return unless $imported;
+
     my $Test = Jifty::Test->builder;
 
     # Such a hack -- try to detect if this is a forked child process and don't


More information about the Jifty-commit mailing list