diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php
index ca66143..4f570ef 100644
--- a/core/modules/simpletest/drupal_web_test_case.php
+++ b/core/modules/simpletest/drupal_web_test_case.php
@@ -74,6 +74,18 @@ abstract class DrupalTestCase {
   protected $skipClasses = array(__CLASS__ => TRUE);
 
   /**
+   * Flag to indicate whether the test has been set up.
+   *
+   * The setUp() method isolates the test from the parent Drupal site by
+   * creating a random prefix for the database and setting up a clean file
+   * storage directory. The tearDown() method then cleans up this test
+   * environment. We must ensure that setUp() has been run, otherwise tearDown()
+   * will act on the parent Drupal site, not the test environment, destroying
+   * live data.
+   */
+  protected $setup = FALSE;
+
+  /**
    * Constructor for DrupalTestCase.
    *
    * @param $test_id
@@ -127,7 +139,15 @@ abstract class DrupalTestCase {
     );
 
     // Store assertion for display after the test has completed.
-    Database::getConnection('default', 'simpletest_original_default')
+    try {
+      $connection = Database::getConnection('default', 'simpletest_original_default');
+    }
+    catch (DatabaseConnectionNotDefinedException $e) {
+      // If the test was not set up, the simpletest_original_default
+      // connection does not eist.
+      $connection = Database::getConnection('default', 'default');
+    }
+    $connection
       ->insert('simpletest')
       ->fields($assertion)
       ->execute();
@@ -474,14 +494,19 @@ abstract class DrupalTestCase {
         );
         $completion_check_id = DrupalTestCase::insertAssert($this->testId, $class, FALSE, t('The test did not complete due to a fatal error.'), 'Completion check', $caller);
         $this->setUp();
-        try {
-          $this->$method();
-          // Finish up.
+        if ($this->setup) {
+          try {
+            $this->$method();
+            // Finish up.
+          }
+          catch (Exception $e) {
+            $this->exceptionHandler($e);
+          }
+          $this->tearDown();
         }
-        catch (Exception $e) {
-          $this->exceptionHandler($e);
+        else {
+          $this->fail(t("The test cannot be executed because it has not been set up properly."));
         }
-        $this->tearDown();
         // Remove the completion check record.
         DrupalTestCase::deleteAssert($completion_check_id);
       }
@@ -691,6 +716,7 @@ class DrupalUnitTestCase extends DrupalTestCase {
       unset($module_list['locale']);
       module_list(TRUE, FALSE, FALSE, $module_list);
     }
+    $this->setup = TRUE;
   }
 
   protected function tearDown() {
@@ -1357,6 +1383,7 @@ class DrupalWebTestCase extends DrupalTestCase {
     variable_set('mail_system', array('default-system' => 'TestingMailSystem'));
 
     drupal_set_time_limit($this->timeLimit);
+    $this->setup = TRUE;
   }
 
   /**
diff --git a/core/modules/simpletest/simpletest.test b/core/modules/simpletest/simpletest.test
index 7a02aa1..dbdab65 100644
--- a/core/modules/simpletest/simpletest.test
+++ b/core/modules/simpletest/simpletest.test
@@ -503,3 +503,59 @@ class SimpleTestMissingDependentModuleUnitTest extends DrupalUnitTestCase {
     $this->fail(t('Running test with missing required module.'));
   }
 }
+
+class SimpleTestBrokenSetUp extends DrupalWebTestCase {
+
+  protected $break_setup = TRUE;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Broken SimpleTest method',
+      'description' => 'Tests a test case that does not call parent::setUp().',
+      'group' => 'SimpleTest'
+    );
+  }
+
+  function setUp() {
+    if ($this->inCURL() && $this->break_setup) {
+      // Don't call parent::setUp().
+    }
+    else {
+      parent::setUp('simpletest');
+
+      // Create and log in user.
+      $admin_user = $this->drupalCreateUser(array('administer unit tests'));
+      $this->drupalLogin($admin_user);
+    }
+  }
+
+  /**
+   * Check if the test is being run from inside a CURL request.
+   */
+  function inCURL() {
+    return (bool) drupal_valid_test_ua();
+  }
+
+  function testBreakSetUp() {
+    // If this is the main request, run the web test script and then assert
+    // that the child site tables were not deleted.
+    if (!$this->inCURL()) {
+      // Run this test from web interface.
+      $this->drupalGet('admin/config/development/testing');
+      $edit = array();
+      $edit['SimpleTestBrokenSetUp'] = TRUE;
+      $this->drupalPost(NULL, $edit, t('Run tests'));
+      $this->assertNoText(t('Base table or view not found'), 'Tables were not deleted.');
+    }
+    // If this is the child request, run a grandchild test without calling
+    // the parent::setUp() method.
+    else {
+      $this->break_setup = TRUE;
+      // Run this test from web interface.
+      $this->drupalGet('admin/config/development/testing');
+      $edit = array();
+      $edit['SimpleTestBrokenSetUp'] = TRUE;
+      $this->drupalPost(NULL, $edit, t('Run tests'));
+    }
+  }
+}
diff --git a/core/modules/simpletest/tests/upgrade/upgrade.test b/core/modules/simpletest/tests/upgrade/upgrade.test
index 69a5384..c53050e 100644
--- a/core/modules/simpletest/tests/upgrade/upgrade.test
+++ b/core/modules/simpletest/tests/upgrade/upgrade.test
@@ -136,6 +136,7 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase {
     $this->variable_set('site_mail', 'simpletest@example.com');
 
     drupal_set_time_limit($this->timeLimit);
+    $this->setup = TRUE;
   }
 
   /**
