From 6b0392dd1788ee645fe4a467fce28d8640d2c8f2 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Fri, 17 Jan 2014 15:04:22 -0800 Subject: [PATCH] Remove django test environment setup code. I've found djangos ./manage.py test to work quite well these days, and attempting to manually setup the django test environment generates an exception on shutdown. --- .../frontend/experiments/test_experiments.py | 21 ------------------- .../frontend/inventory/test_inventory.py | 9 -------- htsworkflow/frontend/samples/test_samples.py | 9 -------- .../submission/test/test_condorfastq.py | 10 --------- 4 files changed, 49 deletions(-) diff --git a/htsworkflow/frontend/experiments/test_experiments.py b/htsworkflow/frontend/experiments/test_experiments.py index 8907192..11214b1 100644 --- a/htsworkflow/frontend/experiments/test_experiments.py +++ b/htsworkflow/frontend/experiments/test_experiments.py @@ -30,17 +30,6 @@ NSMAP = {'libns':'http://jumpgate.caltech.edu/wiki/LibraryOntology#'} from django.db import connection -OLD_DB_NAME = settings.DATABASES['default']['NAME'] -VERBOSITY = 0 -def setUpModule(): - setup_test_environment() - settings.DEBUG = False - connection.creation.create_test_db(VERBOSITY) - -def tearDownModule(): - connection.creation.destroy_test_db(OLD_DB_NAME, VERBOSITY) - teardown_test_environment() - class ClusterStationTestCases(TestCase): fixtures = ['test_flowcells.json'] @@ -688,16 +677,6 @@ class TestSequencer(TestCase): errmsgs = list(inference.run_validation()) self.assertEqual(len(errmsgs), 0) - -OLD_DB = settings.DATABASES['default']['NAME'] -def setUpModule(): - setup_test_environment() - connection.creation.create_test_db() - -def tearDownModule(): - connection.creation.destroy_test_db(OLD_DB) - teardown_test_environment() - def suite(): from unittest2 import TestSuite, defaultTestLoader suite = TestSuite() diff --git a/htsworkflow/frontend/inventory/test_inventory.py b/htsworkflow/frontend/inventory/test_inventory.py index 86d37b7..d7c2336 100644 --- a/htsworkflow/frontend/inventory/test_inventory.py +++ b/htsworkflow/frontend/inventory/test_inventory.py @@ -113,15 +113,6 @@ class InventoryTestCase(TestCase): flowcells = [ str(x.uri) for x in targets] return flowcells -OLD_DB = settings.DATABASES['default']['NAME'] -def setUpModule(): - setup_test_environment() - connection.creation.create_test_db() - -def tearDownModule(): - connection.creation.destroy_test_db(OLD_DB) - teardown_test_environment() - def suite(): from unittest2 import TestSuite, defaultTestLoader suite = TestSuite() diff --git a/htsworkflow/frontend/samples/test_samples.py b/htsworkflow/frontend/samples/test_samples.py index f0844e5..594f281 100644 --- a/htsworkflow/frontend/samples/test_samples.py +++ b/htsworkflow/frontend/samples/test_samples.py @@ -332,15 +332,6 @@ def get_rdf_memory_model(): model = RDF.Model(storage) return model -OLD_DB = settings.DATABASES['default']['NAME'] -def setUpModule(): - setup_test_environment() - connection.creation.create_test_db() - -def tearDownModule(): - connection.creation.destroy_test_db(OLD_DB) - teardown_test_environment() - def suite(): from unittest2 import TestSuite, defaultTestLoader suite = TestSuite() diff --git a/htsworkflow/submission/test/test_condorfastq.py b/htsworkflow/submission/test/test_condorfastq.py index 09d6808..1e1c2d9 100644 --- a/htsworkflow/submission/test/test_condorfastq.py +++ b/htsworkflow/submission/test/test_condorfastq.py @@ -680,16 +680,6 @@ class TestCondorFastq(TestCase): self.assertTrue('12345_C02F9ACXX_c202_l3_r2.fastq' in arguments[3]) -OLD_DB = settings.DATABASES['default']['NAME'] -def setUpModule(): - setup_test_environment() - connection.creation.create_test_db() - -def tearDownModule(): - connection.creation.destroy_test_db(OLD_DB) - teardown_test_environment() - - def suite(): from unittest2 import TestSuite, defaultTestLoader suite = TestSuite() -- 2.30.2